Diff between two blobs should take mode changes into account now.
[gitweb.git] / pkt-line.c
index 3d724acf23fab5e8a8e3dd5b1dce957ea1d4a9d3..b4cb7e2756dcc52c17aebf4c0fc6adc7b415ef3c 100644 (file)
@@ -22,7 +22,7 @@ ssize_t safe_write(int fd, const void *buf, ssize_t n)
        while (n) {
                int ret = xwrite(fd, buf, n);
                if (ret > 0) {
-                       buf += ret;
+                       buf = (char *) buf + ret;
                        n -= ret;
                        continue;
                }
@@ -68,11 +68,11 @@ static void safe_read(int fd, void *buffer, unsigned size)
        int n = 0;
 
        while (n < size) {
-               int ret = xread(fd, buffer + n, size - n);
+               int ret = xread(fd, (char *) buffer + n, size - n);
                if (ret < 0)
                        die("read error (%s)", strerror(errno));
                if (!ret)
-                       die("unexpected EOF");
+                       die("The remote end hung up unexpectedly");
                n += ret;
        }
 }