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 <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
John Keeping committed
Feb 16, 2014 at 16:06 UTC
df5213b70d29e65aaff17d2577e42787e5a272bb
1 file changed
+1
-1
utf8.c
+1
-1
@@ -529,7 +529,7 @@ char *reencode_string_iconv(const char *in, size_t insz, iconv_t conv, int *outs
529
while (1) {
530
size_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz);
531
532
- if (cnt == -1) {
532
+ if (cnt == (size_t) -1) {
533
size_t sofar;
534
if (errno != E2BIG) {
535
free(out);