From fb948c7f23a798b0c6667003261985c667a65ed6 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Thu, 25 Dec 2025 13:07:38 +0100 Subject: Actually take next_id as a pointer --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index bd7e57a..8d78f52 100644 --- a/src/main.c +++ b/src/main.c @@ -225,7 +225,7 @@ static void canonicalize(char *out, const char *in) } /* Add a new file to the databse, prompting the user for needed information. */ -static void ftag_add_one_file(sqlite3 *db, int next_id, const char *file) +static void ftag_add_one_file(sqlite3 *db, int *next_id, const char *file) { char sql[2048]; int rc; @@ -307,7 +307,7 @@ static void ftag_add_one_file(sqlite3 *db, int next_id, const char *file) memset(sql, 0, sizeof(sql)); snprintf(sql, sizeof(sql)-1, "INSERT INTO files VALUES(%d, '%s', '%s', '%s', %ld)", - next_id, canonical_name, full_name, description, date); + *next_id, canonical_name, full_name, description, date); rc = sqlite3_exec(db, sql, NULL, NULL, NULL); sqlite3_check(rc, db); (*next_id)++; -- cgit v1.2.3