From df5213b70d29e65aaff17d2577e42787e5a272bb Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 16 Feb 2014 16:06:03 +0000 Subject: [PATCH] utf8: fix iconv error detection iconv(3) returns "(size_t) -1" on error. Make sure that we cast the "-1" properly when checking for this. Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utf8.c b/utf8.c index 0d20e0acb2..24c3c5cedd 100644 --- a/utf8.c +++ b/utf8.c @@ -529,7 +529,7 @@ char *reencode_string_iconv(const char *in, size_t insz, iconv_t conv, int *outs while (1) { size_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz); - if (cnt == -1) { + if (cnt == (size_t) -1) { size_t sofar; if (errno != E2BIG) { free(out); -- 2.11.4.GIT