summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorLibravatar Jim Meyering <jim@meyering.net>2011-05-26 16:34:20 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-05-26 11:25:59 -0700
commit23c7df6bdd13e3d99ca09b6a7655747cc29ccc41 (patch)
treef154bdb57270bd7853c2e6757da3e47ca8cfbb5c /sha1_file.c
parentstreaming: read loose objects incrementally (diff)
downloadtgif-23c7df6bdd13e3d99ca09b6a7655747cc29ccc41.tar.xz
sha1_file: use the correct type (ssize_t, not size_t) for read-style function
Using an unsigned type, we would fail to detect a read error and then proceed to try to write (size_t)-1 bytes. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 5fc877fe4c..8a85217996 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2733,7 +2733,7 @@ static int index_stream(unsigned char *sha1, int fd, size_t size,
while (size) {
char buf[10240];
size_t sz = size < sizeof(buf) ? size : sizeof(buf);
- size_t actual;
+ ssize_t actual;
actual = read_in_full(fd, buf, sz);
if (actual < 0)