Better default octal detection in strtol(3).

This commit is contained in:
Jonas 'Sortie' Termansen 2011-12-16 22:24:29 +01:00
parent 73bcafc004
commit 203f2a2bb1
1 changed files with 1 additions and 1 deletions

View File

@ -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; }