SQLite

Check-in [05eba9e3a5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the sqlite3GetInt32() function so that it correctly returns 0 on a zero-length input string.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 05eba9e3a5f9bb2a40af1dacd885e1915fbcd20b9af4cf0eed79ac16dbeba31b
User & Date: drh 2017-05-03 17:44:28.665
Context
2017-05-03
19:36
Remove the unused "sqlite3_stack_used" TCL command from the test harness. (check-in: e24b73820c user: drh tags: trunk)
17:44
Fix the sqlite3GetInt32() function so that it correctly returns 0 on a zero-length input string. (check-in: 05eba9e3a5 user: drh tags: trunk)
15:54
Always enable URI filenames when compiling with SQLITE_HAS_CODEC. Also allow plaintext keys using the key= query parameter. (check-in: 31a51b4d16 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/util.c.
709
710
711
712
713
714
715

716
717
718
719
720
721
722
      memcpy(pValue, &u, 4);
      return 1;
    }else{
      return 0;
    }
  }
#endif

  while( zNum[0]=='0' ) zNum++;
  for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){
    v = v*10 + c;
  }

  /* The longest decimal representation of a 32 bit integer is 10 digits:
  **







>







709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
      memcpy(pValue, &u, 4);
      return 1;
    }else{
      return 0;
    }
  }
#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;
  }

  /* The longest decimal representation of a 32 bit integer is 10 digits:
  **