mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-14 23:31:39 +00:00
Note to self: do not write code late at night
This commit is contained in:
parent
5753f2c58b
commit
ea97fe42dd
@ -167,11 +167,14 @@ unsigned long strtoul ( const char *p, char **endp, int base ) {
|
||||
}
|
||||
|
||||
while ( 1 ) {
|
||||
charval = ( *p - '0' );
|
||||
if ( charval > ( 'A' - '0' - 10 ) )
|
||||
charval -= ( 'A' - '0' - 10 );
|
||||
if ( charval > ( 'a' - 'A' ) )
|
||||
charval -= ( 'a' - 'A' );
|
||||
charval = *p;
|
||||
if ( charval >= 'a' ) {
|
||||
charval = ( charval - 'a' + 10 );
|
||||
} else if ( charval >= 'A' ) {
|
||||
charval = ( charval - 'A' + 10 );
|
||||
} else {
|
||||
charval = ( charval - '0' );
|
||||
}
|
||||
if ( charval >= ( unsigned int ) base )
|
||||
break;
|
||||
ret = ( ( ret * base ) + charval );
|
||||
|
Loading…
Reference in New Issue
Block a user