Code

Fix signedness on return value from xread()
authorJohan Herland <johan@herland.net>
Tue, 15 May 2007 12:39:25 +0000 (14:39 +0200)
committerJunio C Hamano <junkio@cox.net>
Wed, 16 May 2007 04:15:54 +0000 (21:15 -0700)
The return value from xread() is ssize_t.
Paolo Teti <paolo.teti@gmail.com> pointed out that in this case, the
signed return value was assigned to an unsigned type (size_t). This patch
fixes that.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
pack-write.c

index de72f44dc8ea5098b5824eb30b119a8508293226..ae2e481e5554cfa66cf137d38c38f961b9aa8ec7 100644 (file)
@@ -25,7 +25,7 @@ void fixup_pack_header_footer(int pack_fd,
 
        buf = xmalloc(buf_sz);
        for (;;) {
-               size_t n = xread(pack_fd, buf, buf_sz);
+               ssize_t n = xread(pack_fd, buf, buf_sz);
                if (!n)
                        break;
                if (n < 0)