1
0
Fork 0
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:
hp.com!davidm 2004-06-29 05:59:35 +00:00
parent c4d1854621
commit 6c61288b9c

View file

@ -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;
}