From b2b5ae80065ff52a77a3b8c08a89c895d151a52f Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 18 Dec 2009 05:26:11 -0500 Subject: [PATCH] Fixed sds.c bug #124 --- TODO | 1 + sds.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 59c0bb142..6a7eb20a9 100644 --- a/TODO +++ b/TODO @@ -75,6 +75,7 @@ it's not a guarantee they'll ever get implemented ;) * Pattern-matching replication. * Don't save empty lists / sets / zsets on disk with snapshotting. * Remove keys when a list / set / zset reaches length of 0. +* Add an option to relax the delete-expiring-keys-on-write semantic *denying* replication and AOF when this is on? Can be handy sometimes, when using Redis for non persistent state. DOCUMENTATION WISHLIST ====================== diff --git a/sds.c b/sds.c index 6d18d1fd0..497d00f58 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;