1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Ignore leading spaces on text to numeric conversions. Ticket #1662.

Fixes to test cases broken by the recent changes to round(). (CVS 3118)

FossilOrigin-Name: cdca3383c54b33aeafbbdbbb4ae7c90796cf66e5
This commit is contained in:
drh
2006-03-03 19:12:29 +00:00
parent 41714d6f83
commit 57bacb2282
7 changed files with 33 additions and 21 deletions

View File

@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.186 2006/02/24 02:53:50 drh Exp $
** $Id: util.c,v 1.187 2006/03/03 19:12:30 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -971,6 +971,7 @@ int sqlite3AtoF(const char *z, double *pResult){
int sign = 1;
const char *zBegin = z;
LONGDOUBLE_TYPE v1 = 0.0;
while( isspace(*z) ) z++;
if( *z=='-' ){
sign = -1;
z++;
@@ -1038,6 +1039,7 @@ int sqlite3atoi64(const char *zNum, i64 *pNum){
i64 v = 0;
int neg;
int i, c;
while( isspace(*zNum) ) zNum++;
if( *zNum=='-' ){
neg = 1;
zNum++;