[PATCH xkbcomp 2/2] Fix incorrect processing of char(0xff) in comments

Alexandr Shadchin alexandr.shadchin at gmail.com
Sun Jan 16 03:36:20 PST 2011


On Sun, Jan 16, 2011 at 4:27 PM, Dirk Wallenstein <halsmit at t-online.de> wrote:
> On Sun, Jan 16, 2011 at 01:26:10AM +0500, Alexandr Shadchin wrote:
>> If type readBuf is char, then scanchar() return -1 for char(0xFF) and EOF.
>> If type readBuf is unsigned char, then scanchar() return 0xFF for char(0xFF)
>> and -1 for EOF.
>
> NAK: I assume you want to correct the case when returning EOF stored
> inside of readBuf?  This would now return EOF as 0x00ff but EOF is a
> negative value.  All parts that access readBuf work with signed values.
>

You are wrong. EOF(value -1) returned if readBufLen == 0. EOF not stored
inside of readBuf (1 patch).

>> Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
>> ---
>>  xkbscan.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/xkbscan.c b/xkbscan.c
>> index 6d3678e..2620a07 100644
>> --- a/xkbscan.c
>> +++ b/xkbscan.c
>> @@ -49,7 +49,7 @@ char scanBuf[1024];
>>  static int scanStrLine = 0;
>>
>>  #define      BUFSIZE 4096
>> -static char readBuf[BUFSIZE];
>> +static unsigned char readBuf[BUFSIZE];
>>  static int readBufPos = 0;
>>  static int readBufLen = 0;
>>
>> --
>> 1.7.3.5
>>
>
> --
> Greetings,
> Dirk
>



-- 
Alexandr Shadchin


More information about the xorg-devel mailing list