diff options
author | drh <> | 2024-11-22 12:29:35 +0000 |
---|---|---|
committer | drh <> | 2024-11-22 12:29:35 +0000 |
commit | ed271dc7ea87ae7e7950b917c00fb02f1afaf141 (patch) | |
tree | f3382fe1d43ce3e72b3568ad5f44ba20b4871179 /src | |
parent | 38fdb2a857a476a862811d5e40952cab5d25f96f (diff) | |
download | sqlite-ed271dc7ea87ae7e7950b917c00fb02f1afaf141.tar.gz sqlite-ed271dc7ea87ae7e7950b917c00fb02f1afaf141.zip |
Fix harmless scanbuild warnings caused by the introduction of the
".dbtotxt" command into the CLI by check-in [b43acf5a8cd4a5ef].
FossilOrigin-Name: 554d8fbd865436ace900859874b6c8c7e1b782184158a86b7788644e27bd1997
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c.in | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/shell.c.in b/src/shell.c.in index 730957bc2..b4d7fc287 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -6632,7 +6632,6 @@ static int shell_dbtotxt_command(ShellState *p, int nArg, char **azArg){ sqlite3_stmt *pStmt = 0; sqlite3_int64 nPage = 0; int pgSz = 0; - const char *zFilename; const char *zTail; char *zName = 0; int rc, i, j; @@ -6660,17 +6659,15 @@ static int shell_dbtotxt_command(ShellState *p, int nArg, char **azArg){ if( nPage<1 ) goto dbtotxt_error; rc = sqlite3_prepare_v2(p->db, "PRAGMA databases", -1, &pStmt, 0); if( rc ) goto dbtotxt_error; - rc = 0; if( sqlite3_step(pStmt)!=SQLITE_ROW ){ - zTail = zFilename = "unk.db"; + zTail = "unk.db"; }else{ - zFilename = (const char*)sqlite3_column_text(pStmt, 2); + const char *zFilename = (const char*)sqlite3_column_text(pStmt, 2); if( zFilename==0 || zFilename[0]==0 ) zFilename = "unk.db"; zTail = strrchr(zFilename, '/'); #if defined(_WIN32) if( zTail==0 ) zTail = strrchr(zFilename, '\\'); #endif - if( zTail ) zFilename = zTail; } zName = strdup(zTail); shell_check_oom(zName); @@ -6681,7 +6678,6 @@ static int shell_dbtotxt_command(ShellState *p, int nArg, char **azArg){ rc = sqlite3_prepare_v2(p->db, "SELECT pgno, data FROM sqlite_dbpage ORDER BY pgno", -1, &pStmt, 0); if( rc ) goto dbtotxt_error; - rc = 0; while( sqlite3_step(pStmt)==SQLITE_ROW ){ sqlite3_int64 pgno = sqlite3_column_int64(pStmt, 0); const u8 *aData = sqlite3_column_blob(pStmt, 1); |