fixed bug in number() -- hex letters mistreated

This commit is contained in:
em 1986-02-03 14:30:19 +00:00
parent ef48465b2a
commit f3e2248cc4

View file

@ -208,11 +208,11 @@ number(s)
}
while (digit = *s++) {
if (digit >= 'A' && digit <= 'F')
digit -= 'A' + 10;
digit = digit - 'A' + 10;
else if (digit >= 'a' && digit <= 'f')
digit -= 'a' + 10;
digit = digit - 'a' + 10;
else if (digit >= '0' && digit <= '9')
digit -= '0';
digit = digit - '0';
else
fatal("wrong digit %c", digit);
if (digit >= radix)