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

Fix the sqlite3GetInt32() function so that it correctly returns 0 on a

zero-length input string.

FossilOrigin-Name: 05eba9e3a5f9bb2a40af1dacd885e1915fbcd20b9af4cf0eed79ac16dbeba31b
This commit is contained in:
drh
2017-05-03 17:44:28 +00:00
parent ad012d09dc
commit 313e6fd222
3 changed files with 8 additions and 7 deletions

View File

@@ -713,6 +713,7 @@ int sqlite3GetInt32(const char *zNum, int *pValue){
}
}
#endif
if( !sqlite3Isdigit(zNum[0]) ) return 0;
while( zNum[0]=='0' ) zNum++;
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){
v = v*10 + c;