summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-09-12 18:45:02 -0400
committerJune McEnroe <june@causal.agency>2021-09-12 18:45:02 -0400
commit7346609955c63d808eeedd40a28d609a31b651c8 (patch)
tree98e4bfd691f2c7f6ece69d1be35378865b128ae1
parentVendor SQLite 3.36.0 (diff)
downloadscooper-7346609955c63d808eeedd40a28d609a31b651c8.tar.gz
scooper-7346609955c63d808eeedd40a28d609a31b651c8.zip
Call sqlite3_initialize explicitly
-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);