From b1905aeac5aded421cd90f8d264e27bb39672b36 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 26 May 2011 12:28:44 -0400 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.c b/setup.c index dadc66659..a975c8b10 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; -- 2.26.2