From 3e8cbd53cf2190d33ef8b8e005e5dcc60b6748de Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 19 Jan 2011 18:10:27 +0100 Subject: Let sds.c figure out where the range stops --- hiredis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hiredis.c b/hiredis.c index 1751366..9ff0b97 100644 --- a/hiredis.c +++ b/hiredis.c @@ -541,7 +541,7 @@ int redisReplyReaderGetReply(void *reader, void **reply) { /* Discard part of the buffer when we've consumed at least 1k, to avoid * doing unnecessary calls to memmove() in sds.c. */ if (r->pos >= 1024) { - r->buf = sdsrange(r->buf,r->pos,r->len); + r->buf = sdsrange(r->buf,r->pos,-1); r->pos = 0; r->len = sdslen(r->buf); } -- cgit v1.2.3