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>
This commit is contained in:
Jeff King
2018-07-24 06:50:33 -04:00
committed by Junio C Hamano
parent 77aa03d6c7
commit c7d017d7e1
5 changed files with 13 additions and 13 deletions

View File

@ -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;