From e73289a5c618a12ee0fd05fb9d5a2b2404c29cd8 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 26 Nov 2010 15:25:19 +0100 Subject: [PATCH] Use r->len in another spot --- hiredis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hiredis.c b/hiredis.c index 5f56bf7..3ee0d0b 100644 --- a/hiredis.c +++ b/hiredis.c @@ -157,7 +157,7 @@ static void *createNilObject(const redisReadTask *task) { static char *readBytes(redisReader *r, unsigned int bytes) { char *p; - if (sdslen(r->buf)-r->pos >= bytes) { + if (r->len-r->pos >= bytes) { p = r->buf+r->pos; r->pos += bytes; return p;