Merge pull request #893 from nparry/fix-redis-cli-rdb

redis-cli --rdb fails if server sends a ping
This commit is contained in:
Salvatore Sanfilippo 2013-01-18 02:41:29 -08:00
commit 21b3ff9ba0

View File

@ -958,8 +958,8 @@ unsigned long long sendSync(int fd) {
fprintf(stderr,"Error reading bulk length while SYNCing\n"); fprintf(stderr,"Error reading bulk length while SYNCing\n");
exit(1); exit(1);
} }
if (*p == '\n') break; if (*p == '\n' && p != buf) break;
p++; if (*p != '\n') p++;
} }
*p = '\0'; *p = '\0';
if (buf[0] == '-') { if (buf[0] == '-') {