Fixed sds.c bug #124

This commit is contained in:
antirez
2009-12-18 05:26:11 -05:00
parent b055378971
commit b2b5ae8006
2 changed files with 2 additions and 1 deletions

2
sds.c
View File

@ -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;