From d848804a895254583095b5c23ebb5d5f5a8891a3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 26 Jan 2007 17:39:03 -0800 Subject: [PATCH] write_in_full: size_t is unsigned. It received the return value from xwrite() in a size_t variable 'written' and expected comparison with 0 would catch an error from xwrite(). Signed-off-by: Junio C Hamano --- write_or_die.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/write_or_die.c b/write_or_die.c index 046e79d48..5c4bc8515 100644 --- a/write_or_die.c +++ b/write_or_die.c @@ -23,7 +23,7 @@ int write_in_full(int fd, const void *buf, size_t count) ssize_t total = 0; while (count > 0) { - size_t written = xwrite(fd, p, count); + ssize_t written = xwrite(fd, p, count); if (written < 0) return -1; if (!written) { -- 2.30.2