[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
windres bug: handling of \x sequences
From: |
Tim Robinson |
Subject: |
windres bug: handling of \x sequences |
Date: |
Wed, 29 May 2002 02:45:05 +0100 |
Hi all,
I've found, and fixed, a nasty bug in windres (at least in the 20011002
Cygwin release whose sources I have). It relates to the handling of hex
characters in \x escape sequences by rclex.l:handle_quotes. Characters
A-Z and a-z were handled wrongly; e.g. \xa2 becomes 2, because the A was
being converted to zero.
Lines 396-399 in the original version I had read:
else if (*t >= 'a' && *t <= 'f')
ch = (ch << 4) | (*t - 'a');
else if (*t >= 'A' && *t <= 'F')
ch = (ch << 4) | (*t - 'A');
They need to be:
else if (*t >= 'a' && *t <= 'f')
ch = (ch << 4) | (*t - 'a' + 10);
else if (*t >= 'A' && *t <= 'F')
ch = (ch << 4) | (*t - 'A' + 10);
--
Tim Robinson <address@hidden>
- windres bug: handling of \x sequences,
Tim Robinson <=