From 82f5fcb37d45c6a44a425a725c11e8ad900aceb5 Mon Sep 17 00:00:00 2001 From: Inkyun Kil Date: Wed, 22 Nov 2017 19:20:19 +0900 Subject: [PATCH] Fix bug for wrong string comparison Change-Id: Ia0559e075c175b3d9bc8d58413013e77b5f8d4a8 Signed-off-by: Inkyun Kil --- backend/sqlite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/sqlite.c b/backend/sqlite.c index 35f7023..78a1c5c 100644 --- a/backend/sqlite.c +++ b/backend/sqlite.c @@ -96,7 +96,7 @@ static sqlite3 *open_sqlite3(const char *dbpath, bool readonly) if (db_exist && r == SQLITE_CORRUPT) { bxt_err("Open '%s' failed: %s", dbpath, sqlite3_errmsg(db)); - if (!strncmp(BASE_DB_PATH, dbpath, strlen(dbpath))) { + if (!strncmp(BASE_DB_PATH, dbpath, strlen(BASE_DB_PATH))) { free(nm); return NULL; } @@ -123,7 +123,7 @@ static sqlite3 *open_sqlite3(const char *dbpath, bool readonly) } if (!db_exist) { - if (strncmp(BASE_DB_PATH, dbpath, strlen(dbpath))) { + if (strncmp(BASE_DB_PATH, dbpath, strlen(BASE_DB_PATH))) { r = sqlite3_exec(db, "PRAGMA journal_mode = WAL", NULL, NULL, NULL); if (r) { @@ -146,7 +146,7 @@ static sqlite3 *open_sqlite3(const char *dbpath, bool readonly) } } - if (strncmp(BASE_DB_PATH, dbpath, strlen(dbpath))) { + if (strncmp(BASE_DB_PATH, dbpath, strlen(BASE_DB_PATH))) { r = sqlite3_wal_autocheckpoint(db, BUXTON_DEFAULT_WAL_AUTOCHECKPOINT); if (r != SQLITE_OK) bxt_err("SET DEFAULT_WAL_AUTOCHECKPOINT failed : %d", r); -- 2.7.4