summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-05-26 16:28:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-26 18:25:13 (GMT)
commitb1905aeac5aded421cd90f8d264e27bb39672b36 (patch)
treee26b89dbe13296cf2dcf7e2b3cfd8af9203df510
parent5dd564895e84eacfc728183fb5a9215665ff59a3 (diff)
downloadgit-b1905aeac5aded421cd90f8d264e27bb39672b36.zip
git-b1905aeac5aded421cd90f8d264e27bb39672b36.tar.gz
git-b1905aeac5aded421cd90f8d264e27bb39672b36.tar.bz2
read_gitfile_gently: use ssize_t to hold read result
Otherwise, a negative error return becomes a very large read value. We catch this in practice because we compare the expected and actual numbers of bytes (and you are not likely to be reading (size_t)-1 bytes), but this makes the correctness a little more obvious. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index dadc666..a975c8b 100644
--- a/setup.c
+++ b/setup.c
@@ -272,7 +272,7 @@ const char *read_gitfile_gently(const char *path)
const char *slash;
struct stat st;
int fd;
- size_t len;
+ ssize_t len;
if (stat(path, &st))
return NULL;