Merge branch 'cb/p4-pre-submit-hook'
[gitweb.git] / utf8.c
diff --git a/utf8.c b/utf8.c
index a2fd24c70a22bd33d3d9f96460b9e52c8ac9fbf3..eb785875042920b84e56abbd235ef9eb7ef22ac4 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -470,7 +470,7 @@ int utf8_fprintf(FILE *stream, const char *format, ...)
 #else
        typedef char * iconv_ibp;
 #endif
-char *reencode_string_iconv(const char *in, size_t insz, iconv_t conv, int *outsz_p)
+char *reencode_string_iconv(const char *in, size_t insz, iconv_t conv, size_t *outsz_p)
 {
        size_t outsz, outalloc;
        char *out, *outpos;
@@ -534,9 +534,9 @@ static const char *fallback_encoding(const char *name)
        return name;
 }
 
-char *reencode_string_len(const char *in, int insz,
+char *reencode_string_len(const char *in, size_t insz,
                          const char *out_encoding, const char *in_encoding,
-                         int *outsz)
+                         size_t *outsz)
 {
        iconv_t conv;
        char *out;
@@ -566,10 +566,10 @@ static int has_bom_prefix(const char *data, size_t len,
        return data && bom && (len >= bom_len) && !memcmp(data, bom, bom_len);
 }
 
-static const char utf16_be_bom[] = {0xFE, 0xFF};
-static const char utf16_le_bom[] = {0xFF, 0xFE};
-static const char utf32_be_bom[] = {0x00, 0x00, 0xFE, 0xFF};
-static const char utf32_le_bom[] = {0xFF, 0xFE, 0x00, 0x00};
+static const char utf16_be_bom[] = {'\xFE', '\xFF'};
+static const char utf16_le_bom[] = {'\xFF', '\xFE'};
+static const char utf32_be_bom[] = {'\0', '\0', '\xFE', '\xFF'};
+static const char utf32_le_bom[] = {'\xFF', '\xFE', '\0', '\0'};
 
 int has_prohibited_utf_bom(const char *enc, const char *data, size_t len)
 {