summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hiredis.c b/hiredis.c
index ffdf027..f0d78a0 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -164,8 +164,17 @@ static char *readBytes(redisReader *r, unsigned int bytes) {
static char *seekNewline(char *s) {
/* Find pointer to \r\n without strstr */
- while(s != NULL && s[0] != '\r' && s[1] != '\n')
+ while (s != NULL) {
s = strchr(s,'\r');
+ if (s != NULL) {
+ if (s[1] == '\n')
+ break;
+ else
+ s++;
+ } else {
+ break;
+ }
+ }
return s;
}