Re: [RFC PATCH 6/6] utf8.c: avoid char overflow

2018-07-09 Thread Johannes Schindelin
Hi Beat, On Mon, 9 Jul 2018, Beat Bolli wrote: > Am 09.07.2018 15:14, schrieb Johannes Schindelin: > > > > On Sun, 8 Jul 2018, Beat Bolli wrote: > > > > > In ISO C, char constants must be in the range -128..127. Change the BOM > > > constants to unsigned char to avoid overflow. > > > > > >

Re: [RFC PATCH 6/6] utf8.c: avoid char overflow

2018-07-09 Thread Junio C Hamano
Junio C Hamano writes: > Beat Bolli writes: > -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};

Re: [RFC PATCH 6/6] utf8.c: avoid char overflow

2018-07-09 Thread Beat Bolli
On 09.07.18 18:33, Junio C Hamano wrote: > Beat Bolli writes: > -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,

Re: [RFC PATCH 6/6] utf8.c: avoid char overflow

2018-07-09 Thread Junio C Hamano
Beat Bolli writes: >>> -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 unsigned char

Re: [RFC PATCH 6/6] utf8.c: avoid char overflow

2018-07-09 Thread Beat Bolli
Am 09.07.2018 16:48, schrieb Beat Bolli: Hi Dscho Am 09.07.2018 15:14, schrieb Johannes Schindelin: Hi Beat, On Sun, 8 Jul 2018, Beat Bolli wrote: In ISO C, char constants must be in the range -128..127. Change the BOM constants to unsigned char to avoid overflow. Signed-off-by: Beat

Re: [RFC PATCH 6/6] utf8.c: avoid char overflow

2018-07-09 Thread Beat Bolli
Hi Dscho Am 09.07.2018 15:14, schrieb Johannes Schindelin: Hi Beat, On Sun, 8 Jul 2018, Beat Bolli wrote: In ISO C, char constants must be in the range -128..127. Change the BOM constants to unsigned char to avoid overflow. Signed-off-by: Beat Bolli --- utf8.c | 10 +- 1 file

Re: [RFC PATCH 6/6] utf8.c: avoid char overflow

2018-07-09 Thread Johannes Schindelin
Hi Beat, On Sun, 8 Jul 2018, Beat Bolli wrote: > In ISO C, char constants must be in the range -128..127. Change the BOM > constants to unsigned char to avoid overflow. > > Signed-off-by: Beat Bolli > --- > utf8.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff

[RFC PATCH 6/6] utf8.c: avoid char overflow

2018-07-08 Thread Beat Bolli
In ISO C, char constants must be in the range -128..127. Change the BOM constants to unsigned char to avoid overflow. Signed-off-by: Beat Bolli --- utf8.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utf8.c b/utf8.c index d55e20c641..833ce00617 100644 ---