aboutsummaryrefslogtreecommitdiff
path: root/tool/sqldiff.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-07-08 02:14:24 +0000
committerdrh <drh@noemail.net>2016-07-08 02:14:24 +0000
commit5225449e5bd7172ad1194d0bc92fa4d27ae5adbd (patch)
treeeb192e9db2a35914713688fc5e0cf32819fabe63 /tool/sqldiff.c
parentc8dcdff37e640b63418456bcc68ab7652b6f4ec6 (diff)
downloadsqlite-5225449e5bd7172ad1194d0bc92fa4d27ae5adbd.tar.gz
sqlite-5225449e5bd7172ad1194d0bc92fa4d27ae5adbd.zip
In the sqldiff program, make sure the first argument to the db_prepare()
utility function is always a valid format string. FossilOrigin-Name: 8bb8d886ffa948cd7bc66c8c62da76bce233be2e
Diffstat (limited to 'tool/sqldiff.c')
-rw-r--r--tool/sqldiff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/sqldiff.c b/tool/sqldiff.c
index 4a5389c60..dbdf726df 100644
--- a/tool/sqldiff.c
+++ b/tool/sqldiff.c
@@ -684,7 +684,7 @@ static void diff_one_table(const char *zTab, FILE *out){
/* Run the query and output differences */
if( !g.bSchemaOnly ){
- pStmt = db_prepare(sql.z);
+ pStmt = db_prepare("%s", sql.z);
while( SQLITE_ROW==sqlite3_step(pStmt) ){
int iType = sqlite3_column_int(pStmt, nPk);
if( iType==1 || iType==2 ){
@@ -1461,7 +1461,7 @@ static void summarize_one_table(const char *zTab, FILE *out){
}
/* Run the query and output difference summary */
- pStmt = db_prepare(sql.z);
+ pStmt = db_prepare("%s", sql.z);
nUpdate = 0;
nInsert = 0;
nDelete = 0;
@@ -2018,7 +2018,7 @@ int main(int argc, char **argv){
xDiff(zTab, out);
}else{
/* Handle tables one by one */
- pStmt = db_prepare( all_tables_sql() );
+ pStmt = db_prepare("%s", all_tables_sql() );
while( SQLITE_ROW==sqlite3_step(pStmt) ){
xDiff((const char*)sqlite3_column_text(pStmt,0), out);
}