Commit 461ebced authored by Mart Lubbers's avatar Mart Lubbers
Browse files

fix number parser (closes #3)

parent da062fb6
Pipeline #48328 passed with stage
in 25 seconds
......@@ -139,12 +139,13 @@ public class Utils
pos += 1 ;
sign = -1 ;
}
if ( s.charAt( pos ) == '0' && (s.charAt( pos + 1 ) == 'X' || s.charAt( pos + 1 ) == 'x') )
int max = s.length() ;
if ( s.length() > pos+2 && s.charAt( pos ) == '0' && (s.charAt( pos + 1 ) == 'X' || s.charAt( pos + 1 ) == 'x') )
{
pos += 2 ;
radix = 16 ;
}
int max = s.length() ;
for( ; pos < max ; pos++ )
{
int d = toDigit( s.charAt( pos ) ) ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment