diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-07-24 14:50:47 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-07-24 14:50:47 -0700 |
| commit | 00da9b2091ef8d1955fa2f021b8ba111ce6a5fed (patch) | |
| tree | 6f06221912c327a5e92ccee1c8ecd0b3bfdd8459 /utf8.c | |
| parent | 26a46437ecfd8ca9ae6c6f59e4905ef301d5a56f (diff) | |
| parent | 2b647a05d7223beacba076e45b3920a8621d28e7 (diff) | |
| download | git-00da9b2091ef8d1955fa2f021b8ba111ce6a5fed.tar.xz | |
Merge branch 'bb/pedantic'
The codebase has been updated to compile cleanly with -pedantic
option.
* bb/pedantic:
utf8.c: avoid char overflow
string-list.c: avoid conversion from void * to function pointer
sequencer.c: avoid empty statements at top level
convert.c: replace "\e" escapes with "\033".
fixup! refs/refs-internal.h: avoid forward declaration of an enum
refs/refs-internal.h: avoid forward declaration of an enum
fixup! connect.h: avoid forward declaration of an enum
connect.h: avoid forward declaration of an enum
Diffstat (limited to 'utf8.c')
| -rw-r--r-- | utf8.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) { |
