1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Fix an utterly harmless "applying zero offset to null pointer" UB warning

in sqlite3AtoF():

FossilOrigin-Name: 052fdf5e58b41ccadaa5aac293ceb4d309ced661d46f3a52be9eb8d01d347a82
This commit is contained in:
drh
2019-12-13 23:38:57 +00:00
parent 0f1fa5de04
commit e3a4f2cf77
3 changed files with 10 additions and 8 deletions

View File

@@ -389,7 +389,7 @@ static LONGDOUBLE_TYPE sqlite3Pow10(int E){
int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){
#ifndef SQLITE_OMIT_FLOATING_POINT
int incr;
const char *zEnd = z + length;
const char *zEnd;
/* sign * significand * (10 ^ (esign * exponent)) */
int sign = 1; /* sign of significand */
i64 s = 0; /* significand */
@@ -403,9 +403,11 @@ int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){
assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
*pResult = 0.0; /* Default return value, in case of an error */
if( length==0 ) return 0;
if( enc==SQLITE_UTF8 ){
incr = 1;
zEnd = z + length;
}else{
int i;
incr = 2;