Create a new sds string starting from a null terminated C string. */
| 154 | |
| 155 | /* Create a new sds string starting from a null terminated C string. */ |
| 156 | sds sdsnew(const char *init) { |
| 157 | size_t initlen = (init == NULL) ? 0 : strlen(init); |
| 158 | return sdsnewlen(init, initlen); |
| 159 | } |
| 160 | |
| 161 | /* Duplicate an sds string. */ |
| 162 | sds sdsdup(const sds s) { |