1
0
mirror of https://github.com/git/git.git synced 2024-09-28 10:00:54 +02:00

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>
This commit is contained in:
Jeff King 2011-05-26 12:28:44 -04:00 committed by Junio C Hamano
parent 5dd564895e
commit b1905aeac5

View File

@ -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;