My Various Git Projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa012e9
)
utf8: fix iconv error detection
author
John Keeping
<john@keeping.me.uk>
Sun, 16 Feb 2014 16:06:03 +0000
(16:06 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 18 Feb 2014 23:51:33 +0000
(15:51 -0800)
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>
utf8.c
patch
|
blob
|
history
diff --git
a/utf8.c
b/utf8.c
index
0d20e0a
..
24c3c5c
100644
(file)
--- 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);