mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
- Fixed: strbin ate the character following a \x sequence and placed one-digit sequences into the high nibble of the output character.
SVN r3625 (trunk)
This commit is contained in:
parent
432aa7e6bb
commit
88fcd743b4
1 changed files with 26 additions and 22 deletions
|
@ -600,18 +600,20 @@ int strbin (char *str)
|
|||
case 'x':
|
||||
case 'X':
|
||||
c = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
p++;
|
||||
for (i = 0; i < 2; i++) {
|
||||
c <<= 4;
|
||||
if (*p >= '0' && *p <= '9')
|
||||
c += *p-'0';
|
||||
c = (c << 4) + *p-'0';
|
||||
else if (*p >= 'a' && *p <= 'f')
|
||||
c += 10 + *p-'a';
|
||||
c = (c << 4) + 10 + *p-'a';
|
||||
else if (*p >= 'A' && *p <= 'F')
|
||||
c += 10 + *p-'A';
|
||||
c = (c << 4) + 10 + *p-'A';
|
||||
else
|
||||
{
|
||||
p--;
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
*str++ = c;
|
||||
break;
|
||||
|
@ -698,18 +700,20 @@ FString strbin1 (const char *start)
|
|||
case 'x':
|
||||
case 'X':
|
||||
c = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
p++;
|
||||
for (i = 0; i < 2; i++) {
|
||||
c <<= 4;
|
||||
if (*p >= '0' && *p <= '9')
|
||||
c += *p-'0';
|
||||
c = (c << 4) + *p-'0';
|
||||
else if (*p >= 'a' && *p <= 'f')
|
||||
c += 10 + *p-'a';
|
||||
c = (c << 4) + 10 + *p-'a';
|
||||
else if (*p >= 'A' && *p <= 'F')
|
||||
c += 10 + *p-'A';
|
||||
c = (c << 4) + 10 + *p-'A';
|
||||
else
|
||||
{
|
||||
p--;
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
result << c;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue