diff options
author | antirez <antirez@gmail.com> | 2014-02-06 12:48:13 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-02-06 12:48:13 +0100 |
commit | c72bed33366583ee39cf333142269512ec90a3c6 (patch) | |
tree | 5a5af3690e46c956cf175113adadebe292823557 | |
parent | cadb2b9bef9307c19a7d08d4fbb43f0ecfe25b23 (diff) | |
download | sds-c72bed33366583ee39cf333142269512ec90a3c6.tar.xz |
sdstrim() return type changed to void.
-rw-r--r-- | sds.c | 6 | ||||
-rw-r--r-- | sds.h | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -352,7 +352,7 @@ sds sdscatprintf(sds s, const char *fmt, ...) { * * Output will be just "Hello World". */ -sds sdstrim(sds s, const char *cset) { +void sdstrim(sds s, const char *cset) { struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr))); char *start, *end, *sp, *ep; size_t len; @@ -366,7 +366,6 @@ sds sdstrim(sds s, const char *cset) { sh->buf[len] = '\0'; sh->free = sh->free+(sh->len-len); sh->len = len; - return s; } /* Turn the string into a smaller (or equal) string containing only the @@ -807,7 +806,8 @@ int main(void) { sdslen(x) == 3 && memcmp(x,"123\0",4) ==0) sdsfree(x); - x = sdstrim(sdsnew("xxciaoyyy"),"xy"); + x = sdsnew("xxciaoyyy"); + sdstrim(x,"xy"); test_cond("sdstrim() correctly trims characters", sdslen(x) == 4 && memcmp(x,"ciao\0",5) == 0) @@ -76,7 +76,7 @@ sds sdscatprintf(sds s, const char *fmt, ...) sds sdscatprintf(sds s, const char *fmt, ...); #endif -sds sdstrim(sds s, const char *cset); +void sdstrim(sds s, const char *cset); void sdsrange(sds s, int start, int end); void sdsupdatelen(sds s); void sdsclear(sds s); |