1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00

do not try float conversion without precision

This commit is contained in:
Kenichi Ishigaki 2010-06-17 02:59:47 +00:00
parent da6c54a517
commit c7a882378e

View file

@ -169,9 +169,11 @@ sqlite_is_number(pTHX_ const char *v)
sprintf(str, "%i", atoi(v));
if (strEQ(str, v)) return 1;
sprintf(format, "%%.%df", precision);
sprintf(str, format, atof(v));
if (strEQ(str, v)) return 2;
if (precision) {
sprintf(format, "%%.%df", precision);
sprintf(str, format, atof(v));
if (strEQ(str, v)) return 2;
}
return 0;
}