summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2014-02-16 16:06:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-02-18 23:51:33 (GMT)
commitdf5213b70d29e65aaff17d2577e42787e5a272bb (patch)
tree0b07154eee43558f2a00d4cc337ae1b55e78b21a /utf8.c
parentaa012e906542dbc533dbc5bafe1c4e0a47bdc59e (diff)
downloadgit-df5213b70d29e65aaff17d2577e42787e5a272bb.zip
git-df5213b70d29e65aaff17d2577e42787e5a272bb.tar.gz
git-df5213b70d29e65aaff17d2577e42787e5a272bb.tar.bz2
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>
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 0d20e0a..24c3c5c 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);