about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--server.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server.c b/server.c
index 6280b4d..de5a8d7 100644
--- a/server.c
+++ b/server.c
@@ -110,7 +110,10 @@ int main(int argc, char *argv[]) {
 	if (optind < argc) path = argv[optind];
 	if (!path) errx(EX_USAGE, "database path required");
 
-	int error = sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY, NULL);
+	int error = sqlite3_initialize();
+	if (error) errx(EX_SOFTWARE, "sqlite3_initialize");
+
+	error = sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY, NULL);
 	if (error) errx(EX_NOINPUT, "%s: %s", path, sqlite3_errmsg(db));
 	sqlite3_busy_timeout(db, 1000);
 	atexit(finalizeAll);