/ Check-in [7e287f20]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a compile of harmless static analyzer warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7e287f2055dcd82c92d1711aec97cb6552a354bb
User & Date: drh 2014-05-31 15:39:53
Context
2014-05-31
15:43
Fix a harmless "scan-build" compiler warning in the command-line shell. check-in: 39fafe0a user: drh tags: trunk
15:39
Fix a compile of harmless static analyzer warnings. check-in: 7e287f20 user: drh tags: trunk
2014-05-30
21:01
Revise locking retry semantics in Win32 VFS to abort early if the file handle is reported as invalid. check-in: a4df4a5b user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/printf.c.

   752    752       }
   753    753       if( p->useMalloc==1 ){
   754    754         zNew = sqlite3DbRealloc(p->db, zOld, p->nAlloc);
   755    755       }else{
   756    756         zNew = sqlite3_realloc(zOld, p->nAlloc);
   757    757       }
   758    758       if( zNew ){
          759  +      assert( p->zText!=0 || p->nChar==0 );
   759    760         if( zOld==0 && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
   760    761         p->zText = zNew;
   761    762       }else{
   762    763         sqlite3StrAccumReset(p);
   763    764         setStrAccumError(p, STRACCUM_NOMEM);
   764    765         return 0;
   765    766       }

Changes to tool/mkkeywordhash.c.

   366    366     nKeyword = j;
   367    367   
   368    368     /* Fill in the lengths of strings and hashes for all entries. */
   369    369     for(i=0; i<nKeyword; i++){
   370    370       Keyword *p = &aKeywordTable[i];
   371    371       p->len = (int)strlen(p->zName);
   372    372       assert( p->len<sizeof(p->zOrigName) );
   373         -    strcpy(p->zOrigName, p->zName);
          373  +    memcpy(p->zOrigName, p->zName, p->len+1);
   374    374       totalLen += p->len;
   375    375       p->hash = (UpperToLower[(int)p->zName[0]]*4) ^
   376    376                 (UpperToLower[(int)p->zName[p->len-1]]*3) ^ p->len;
   377    377       p->id = i+1;
   378    378     }
   379    379   
   380    380     /* Sort the table from shortest to longest keyword */