mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-26 17:17:39 +01: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)
|
||||
{
|
||||
digit = *cp++;
|
||||
digit = *cp;
|
||||
if ((digit - '0') <= 9)
|
||||
digit -= '0';
|
||||
{
|
||||
digit -= '0';
|
||||
++cp;
|
||||
}
|
||||
else
|
||||
break;
|
||||
val = (10 * val) + digit;
|
||||
|
@ -159,7 +162,11 @@ scan_char (char *cp, char *valp)
|
|||
if (!cp)
|
||||
return NULL;
|
||||
|
||||
*valp = *cp++;
|
||||
*valp = *cp;
|
||||
|
||||
/* don't step over NUL terminator */
|
||||
if (*cp)
|
||||
++cp;
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue