mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-09-27 08:59:28 +02:00
(scan_dec): Don't skip over a character unless it's really a digit.
(scan_char): Don't skip over NUL terminator. (Logical change 1.238)
This commit is contained in:
parent
c4d1854621
commit
6c61288b9c
1 changed files with 10 additions and 3 deletions
|
@ -139,9 +139,12 @@ scan_dec (char *cp, unsigned long *valp)
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
digit = *cp++;
|
digit = *cp;
|
||||||
if ((digit - '0') <= 9)
|
if ((digit - '0') <= 9)
|
||||||
digit -= '0';
|
{
|
||||||
|
digit -= '0';
|
||||||
|
++cp;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
val = (10 * val) + digit;
|
val = (10 * val) + digit;
|
||||||
|
@ -159,7 +162,11 @@ scan_char (char *cp, char *valp)
|
||||||
if (!cp)
|
if (!cp)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
*valp = *cp++;
|
*valp = *cp;
|
||||||
|
|
||||||
|
/* don't step over NUL terminator */
|
||||||
|
if (*cp)
|
||||||
|
++cp;
|
||||||
return cp;
|
return cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue