]> git.sesse.net Git - nageru/commitdiff
Supposedly sqlite_prepare() is deprecated in favor of sqlite_prepare_v2().
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 25 Nov 2018 17:29:26 +0000 (18:29 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 25 Nov 2018 22:36:26 +0000 (23:36 +0100)
db.cpp

diff --git a/db.cpp b/db.cpp
index c3e647cf46343885360c58007da9d970aabe80af..b0f529b4331d2b4d0019223d43b7b6b3edb40cce 100644 (file)
--- a/db.cpp
+++ b/db.cpp
@@ -25,7 +25,7 @@ StateProto DB::get_state()
        StateProto state;
 
        sqlite3_stmt *stmt;
-       int ret = sqlite3_prepare(db, "SELECT state FROM state", -1, &stmt, 0);
+       int ret = sqlite3_prepare_v2(db, "SELECT state FROM state", -1, &stmt, 0);
        if (ret != SQLITE_OK) {
                fprintf(stderr, "SELECT prepare: %s\n", sqlite3_errmsg(db));
                exit(1);
@@ -70,7 +70,7 @@ void DB::store_state(const StateProto &state)
        }
 
        sqlite3_stmt *stmt;
-       ret = sqlite3_prepare(db, "INSERT INTO state VALUES (?)", -1, &stmt, 0);
+       ret = sqlite3_prepare_v2(db, "INSERT INTO state VALUES (?)", -1, &stmt, 0);
        if (ret != SQLITE_OK) {
                fprintf(stderr, "INSERT prepare: %s\n", sqlite3_errmsg(db));
                exit(1);