]> git.saurik.com Git - redis.git/blobdiff - src/zipmap.c
Use helper functions in APPEND
[redis.git] / src / zipmap.c
index 35faeabefa78434046e9cc6d922389255ec6d04d..be780a828ca849652c2c5d2ea6e8d88f0761d111 100644 (file)
@@ -374,14 +374,14 @@ void zipmapRepr(unsigned char *p) {
             l = zipmapDecodeLength(p);
             printf("{key %u}",l);
             p += zipmapEncodeLength(NULL,l);
-            fwrite(p,l,1,stdout);
+            if (l != 0 && fwrite(p,l,1,stdout) == 0) perror("fwrite");
             p += l;
 
             l = zipmapDecodeLength(p);
             printf("{value %u}",l);
             p += zipmapEncodeLength(NULL,l);
             e = *p++;
-            fwrite(p,l,1,stdout);
+            if (l != 0 && fwrite(p,l,1,stdout) == 0) perror("fwrite");
             p += l+e;
             if (e) {
                 printf("[");