summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-07-24 10:50:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-24 17:19:29 (GMT)
commitc7d017d7e1cca37ca20f73c11fa9f1b319a2c3a5 (patch)
tree41b17395ddd01ae0436d78b906578f7b4861c054 /strbuf.c
parent77aa03d6c7f07db4a5d34afe8f5b3a55e801057c (diff)
downloadgit-c7d017d7e1cca37ca20f73c11fa9f1b319a2c3a5.zip
git-c7d017d7e1cca37ca20f73c11fa9f1b319a2c3a5.tar.gz
git-c7d017d7e1cca37ca20f73c11fa9f1b319a2c3a5.tar.bz2
reencode_string: use size_t for string lengths
The iconv interface takes a size_t, which is the appropriate type for an in-memory buffer. But our reencode_string_* functions use integers, meaning we may get confusing results when the sizes exceed INT_MAX. Let's use size_t consistently. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strbuf.c b/strbuf.c
index b0716ac..e79758b 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -134,7 +134,7 @@ void strbuf_ltrim(struct strbuf *sb)
int strbuf_reencode(struct strbuf *sb, const char *from, const char *to)
{
char *out;
- int len;
+ size_t len;
if (same_encoding(from, to))
return 0;