X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/ed10f40b1520cef2fa633c94289ff9f3241bb3f6..d894161b850458f76284941a207ffc42fe14c7ba:/sds.c diff --git a/sds.c b/sds.c index 6d18d1fd..497d00f5 100644 --- a/sds.c +++ b/sds.c @@ -140,7 +140,7 @@ sds sdscpylen(sds s, char *t, size_t len) { size_t totlen = sh->free+sh->len; if (totlen < len) { - s = sdsMakeRoomFor(s,len-totlen); + s = sdsMakeRoomFor(s,len-sh->len); if (s == NULL) return NULL; sh = (void*) (s-(sizeof(struct sdshdr))); totlen = sh->free+sh->len;