mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Better default octal detection in strtol(3).
This commit is contained in:
parent
73bcafc004
commit
203f2a2bb1
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ namespace Maxsi
|
|||
if ( !base && str[0] == '0' )
|
||||
{
|
||||
if ( str[1] == 'x' || str[1] == 'X' ) { str += 2; base = 16; }
|
||||
else { str++; base = 8; }
|
||||
else if ( 0 <= Debase(str[1]) && Debase(str[1]) < 8 ) { str++; base = 8; }
|
||||
}
|
||||
if ( !base ) { base = 10; }
|
||||
if ( origbase == 16 && str[0] == '0' && (str[1] == 'x' || str[1] == 'X') ) { str += 2; }
|
||||
|
|
Loading…
Add table
Reference in a new issue