aboutsummaryrefslogtreecommitdiff
path: root/src/shell.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-06-17 17:08:22 +0000
committerdrh <drh@noemail.net>2015-06-17 17:08:22 +0000
commitbbe031f9f1260fd97622cfd47dbdf5377daee6b2 (patch)
treef7e6e87430d405655e3086e9720b410c5a8f7ed9 /src/shell.c
parentb0870486aa7da180d8d2554b30d0e973dc99dd20 (diff)
downloadsqlite-bbe031f9f1260fd97622cfd47dbdf5377daee6b2.tar.gz
sqlite-bbe031f9f1260fd97622cfd47dbdf5377daee6b2.zip
Fix a uninitialized variable use in the command-line shell when the
".open" command is invoked without any arguments. FossilOrigin-Name: fc4f4d1eccec2e09b5d2e6c4da082204f4d5a016
Diffstat (limited to 'src/shell.c')
-rw-r--r--src/shell.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/shell.c b/src/shell.c
index 402e9389d..ef3f73d38 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3354,9 +3354,8 @@ static int do_meta_command(char *zLine, ShellState *p){
const char *zSavedFilename = p->zDbFilename;
char *zNewFilename = 0;
p->db = 0;
- if( nArg>=2 ){
- p->zDbFilename = zNewFilename = sqlite3_mprintf("%s", azArg[1]);
- }
+ if( nArg>=2 ) zNewFilename = sqlite3_mprintf("%s", azArg[1]);
+ p->zDbFilename = zNewFilename;
open_db(p, 1);
if( p->db!=0 ){
sqlite3_close(savedDb);