Hex numbers didn't work. Corrected bug in myatoi().
This commit is contained in:
parent
d112eb710c
commit
ef48465b2a
|
@ -319,7 +319,7 @@ int myatoi(s) register char *s; {
|
|||
case 'e':
|
||||
case 'f':
|
||||
if (base!=16) error("Hexletter in number not expected");
|
||||
sum = sum*base + *s++ - 'a';
|
||||
sum = sum*base + 10 + *s++ - 'a';
|
||||
break;
|
||||
case 'A':
|
||||
case 'B':
|
||||
|
@ -328,7 +328,7 @@ int myatoi(s) register char *s; {
|
|||
case 'E':
|
||||
case 'F':
|
||||
if (base!=16) error("Hexletter in number not expected");
|
||||
sum = sum*base + *s++ - 'A';
|
||||
sum = sum*base + 10 + *s++ - 'A';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue