Merge pull request #23 from mingodad/patch-1
Fix conversion of integers base >= 14
This commit is contained in:
commit
c6f7004e57
@ -17,11 +17,12 @@ static bool str2num(const SQChar *s,SQObjectPtr &res,SQInteger base)
|
|||||||
{
|
{
|
||||||
SQChar *end;
|
SQChar *end;
|
||||||
const SQChar *e = s;
|
const SQChar *e = s;
|
||||||
|
SQBool isEIntBase = base > 13; //to fix error converting hexadecimals with e like 56f0791e
|
||||||
SQBool isfloat = SQFalse;
|
SQBool isfloat = SQFalse;
|
||||||
SQChar c;
|
SQChar c;
|
||||||
while((c = *e) != _SC('\0'))
|
while((c = *e) != _SC('\0'))
|
||||||
{
|
{
|
||||||
if(c == _SC('.') || c == _SC('E')|| c == _SC('e')) { //e and E is for scientific notation
|
if(c == _SC('.') || (!isEIntBase && (c == _SC('E')|| c == _SC('e')))) { //e and E is for scientific notation
|
||||||
isfloat = SQTrue;
|
isfloat = SQTrue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user