aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-06-22 18:42:33 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-23 16:57:15 -0700
commit6651c3f706cc47d8055ab43f9f7907202d10655d (patch)
tree88eabb5c4a3431fa8f3489565ace175167232217 /strbuf.c
parent1ab012cf811abba5745fa0da70db963decd65f21 (diff)
downloadgit-6651c3f706cc47d8055ab43f9f7907202d10655d.tar.gz
git-6651c3f706cc47d8055ab43f9f7907202d10655d.tar.xz
fread does not return negative on error
size_t res cannot be less than 0. fread returns 0 on error. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strbuf.c b/strbuf.c
index a88496030..f03d11702 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -260,7 +260,7 @@ size_t strbuf_fread(struct strbuf *sb, size_t size, FILE *f)
res = fread(sb->buf + sb->len, 1, size, f);
if (res > 0)
strbuf_setlen(sb, sb->len + res);
- else if (res < 0 && oldalloc == 0)
+ else if (oldalloc == 0)
strbuf_release(sb);
return res;
}