]> git.saurik.com Git - redis.git/commitdiff
Fixed sds.c bug #124
authorantirez <antirez@gmail.com>
Fri, 18 Dec 2009 10:26:11 +0000 (05:26 -0500)
committerantirez <antirez@gmail.com>
Fri, 18 Dec 2009 10:26:11 +0000 (05:26 -0500)
TODO
sds.c

diff --git a/TODO b/TODO
index 59c0bb14238ed41d0897593db0e3972860676159..6a7eb20a969dfcc15fcfff4218eea3afdde519e6 100644 (file)
--- 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 6d18d1fd008b18e5e6de7785ecb47224aa04efe7..497d00f58e304228e59b1cea424e3b8fa6d3cb3b 100644 (file)
--- 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;