From 79b397e07f42e71cc9cc87720808f7aa897d5a6d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 10 Nov 2017 16:32:20 +0100 Subject: [PATCH] fix config_get, has no default. --- src/kernel/dbsqlite.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kernel/dbsqlite.c b/src/kernel/dbsqlite.c index b57d65937..602e7071b 100644 --- a/src/kernel/dbsqlite.c +++ b/src/kernel/dbsqlite.c @@ -64,8 +64,12 @@ int db_save_order(order_data *od) void db_open(void) { int err; - const char *dbname = config_get("config.dbname", ""); + const char *dbname; + dbname = config_get("config.dbname"); + if (!dbname) { + dbname = ""; + } err = sqlite3_open(dbname, &g_db); assert(err == SQLITE_OK); err = sqlite3_exec(g_db, "CREATE TABLE IF NOT EXISTS orders (id INTEGER PRIMARY KEY, data TEXT NOT NULL)", NULL, NULL, NULL);