diff --git a/src/redis-cli.c b/src/redis-cli.c index c3938636b43fe11461e30c8a1a9e027dad94a807..0bc61bb25a0c4ade3f4eeb23186dd97a023f8e02 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -958,8 +958,8 @@ unsigned long long sendSync(int fd) { fprintf(stderr,"Error reading bulk length while SYNCing\n"); exit(1); } - if (*p == '\n') break; - p++; + if (*p == '\n' && p != buf) break; + if (*p != '\n') p++; } *p = '\0'; if (buf[0] == '-') {