aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2025-01-11 14:43:47 +0000
committerdrh <>2025-01-11 14:43:47 +0000
commit4b5e8c926ac48d83f70ae9fc1db8a6a9f6b73454 (patch)
treeb36b8e6c32319394166c6463dd9d91d49e4d62da /src
parent27661f24cd6fc71387af5a48caf3fc38dffe1b14 (diff)
downloadsqlite-4b5e8c926ac48d83f70ae9fc1db8a6a9f6b73454.tar.gz
sqlite-4b5e8c926ac48d83f70ae9fc1db8a6a9f6b73454.zip
Better job at suppressing harmless scan-build warnings. This time testing
and working. FossilOrigin-Name: c847973947de67579fab78a65ecfc90bf59fd5db0b7fa7a9c1abb1fc92213d01
Diffstat (limited to 'src')
-rw-r--r--src/expr.c2
-rw-r--r--src/shell.c.in4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index 8c118d077..ca5b9092e 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -3285,7 +3285,7 @@ int sqlite3FindInIndex(
if( aiMap ) aiMap[i] = j;
}
- assert( nExpr<BMS );
+ assert( nExpr>0 && nExpr<BMS );
assert( i==nExpr || colUsed!=(MASKBIT(nExpr)-1) );
if( colUsed==(MASKBIT(nExpr)-1) ){
/* If we reach this point, that means the index pIdx is usable */
diff --git a/src/shell.c.in b/src/shell.c.in
index 4da92072d..db0604eb1 100644
--- a/src/shell.c.in
+++ b/src/shell.c.in
@@ -10122,6 +10122,7 @@ static int do_meta_command(char *zLine, ShellState *p){
#else
FILE *pfPipe = sqlite3_popen(zFile + 1, "w");
if( pfPipe==0 ){
+ assert( stderr!=NULL );
sqlite3_fprintf(stderr,"Error: cannot open pipe \"%s\"\n", zFile + 1);
rc = 1;
}else{
@@ -10134,7 +10135,8 @@ static int do_meta_command(char *zLine, ShellState *p){
FILE *pfFile = output_file_open(zFile);
if( pfFile==0 ){
if( cli_strcmp(zFile,"off")!=0 ){
- sqlite3_fprintf(stderr,"Error: cannot write to \"%s\"\n", zFile);
+ assert( stderr!=NULL );
+ sqlite3_fprintf(stderr,"Error: cannot write to \"%s\"\n", zFile);
}
rc = 1;
} else {