]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix compiler warnings in the CLI detected by MSVC.
authordrh <>
Sat, 24 Aug 2024 20:01:05 +0000 (20:01 +0000)
committerdrh <>
Sat, 24 Aug 2024 20:01:05 +0000 (20:01 +0000)
FossilOrigin-Name: 23ae505cbfde6dfd1dbb2216cf76c1e316b49f2ca84491a1aae28ad33f7777a9

manifest
manifest.uuid
src/shell.c.in

index da0380bd95ae55c0195a5b33be2f95d51c01a496..ba33622d873328ac9da86bf7af75ac929798f370 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Improved\shelp\smessage\sfor\sthe\s--enable-test-status\sconfiguration\soption.\nFix\sthe\sbuild\sfor\swhen\sthat\soption\sis\somitted.
-D 2024-08-24T19:06:52.229
+C Fix\scompiler\swarnings\sin\sthe\sCLI\sdetected\sby\sMSVC.
+D 2024-08-24T20:01:05.217
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -765,7 +765,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
 F src/resolve.c 2c127880c0634962837f16f2f48a295e514357af959330cc038de73015d5b5e8
 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
-F src/shell.c.in 990e77ca805273edd55071c71327d202f1854e19c2e9437c039d91ff3192d7c4
+F src/shell.c.in fa98789df3e106eac287b001decd28ef7fe703c119282f91294af32d5c18ce10
 F src/sqlite.h.in f07bff4225a1244efd604a0ffef81ed69f29d3dbaed7e22f906f26229ba3ca9e
 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
@@ -2210,8 +2210,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 9ca8513c26e54c97f2d3c6105c42144100044727f6fb4c28048f7cd7270dd35e
-R af6e572379558bf7f71bf69d4df3ecc4
+P b404a5fe3f0532f6d56b5e65c44a59379c17d175c21ac69a1f2ba8aadf453313
+R 1dc458f3efda36153cdb87bbe3ce0cfd
 U drh
-Z 30edae94264472f64c3131f2153cb3fe
+Z e6cd8d3cc158f5893ff38516ff50820a
 # Remove this line to create a well-formed Fossil manifest.
index f9406ce800ae889c3695c864ddab3f5870c9a34f..5d64c9e710b1068bb55571f3bc99812c9501563b 100644 (file)
@@ -1 +1 @@
-b404a5fe3f0532f6d56b5e65c44a59379c17d175c21ac69a1f2ba8aadf453313
+23ae505cbfde6dfd1dbb2216cf76c1e316b49f2ca84491a1aae28ad33f7777a9
index 1a1d357749ecdcc476b7d33a3d4d3594bb1bfa51..ab17f46e14a3779db733477a94e9b6ba73bd6c3f 100644 (file)
@@ -3556,10 +3556,11 @@ static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){
     }else if( strncmp(zVar, "$int_", 5)==0 ){
       sqlite3_bind_int(pStmt, i, atoi(&zVar[5]));
     }else if( strncmp(zVar, "$text_", 6)==0 ){
-      char *zBuf = sqlite3_malloc64( strlen(zVar)-5 );
+      size_t szVar = strlen(zVar);
+      char *zBuf = sqlite3_malloc64( szVar-5 );
       if( zBuf ){
-        memcpy(zBuf, &zVar[6], strlen(zVar)-5);
-        sqlite3_bind_text64(pStmt, i, zBuf, -1, sqlite3_free, SQLITE_UTF8);
+        memcpy(zBuf, &zVar[6], szVar-5);
+        sqlite3_bind_text64(pStmt, i, zBuf, szVar-6, sqlite3_free, SQLITE_UTF8);
       }
     }else{
       sqlite3_bind_null(pStmt, i);
@@ -11052,7 +11053,7 @@ static int do_meta_command(char *zLine, ShellState *p){
           for(ii=2; ii<nArg; ii++){
             const char *z = azArg[ii];
             int useLabel = 0;
-            const char *zLabel;
+            const char *zLabel = 0;
             if( (z[0]=='+'|| z[0]=='-') && !IsDigit(z[1]) ){
               useLabel = z[0];
               zLabel = &z[1];