mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix strtol("0xz", &s, 16) handling.
Found by musl's libc-test.
This commit is contained in:
parent
88dd70991c
commit
0adfceef87
1 changed files with 2 additions and 1 deletions
|
@ -164,7 +164,8 @@ STRTOL_INT STRTOL(const STRTOL_CHAR* restrict str,
|
|||
// Skip the leading '0x' prefix in base 16 for hexadecimal integers.
|
||||
if ( origbase == 16 &&
|
||||
str[0] == STRTOL_L('0') &&
|
||||
(str[1] == STRTOL_L('x') || str[1] == STRTOL_L('X')) )
|
||||
(str[1] == STRTOL_L('x') || str[1] == STRTOL_L('X')) &&
|
||||
(0 <= debase(str[2]) && debase(str[2]) < 16) )
|
||||
str += 2;
|
||||
|
||||
// Determine what value will be returned on overflow/underflow.
|
||||
|
|
Loading…
Reference in a new issue