From 1876340763364998f45015bcfa6ee755eeef46bf Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Thu, 25 Dec 2025 13:03:07 +0100 Subject: Increment file table id from ftag_add_one_file I don't remember the reason for doing this but there is one. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 0dd5633..51a3ef8 100644 --- a/src/main.c +++ b/src/main.c @@ -312,6 +312,7 @@ static void ftag_add_one_file(sqlite3 *db, next_id, canonical_name, full_name, description, date); rc = sqlite3_exec(db, sql, NULL, NULL, NULL); sqlite3_check(rc, db); + (*next_id)++; char new_path[512]; memset(new_path, 0, sizeof(new_path)); @@ -361,8 +362,7 @@ static void ftag_file_add(int argc, char **argv) sqlite3_check(rc, db); int next_id = table_next_id(db, "files"); for (int i = 0; i < argc; i++) { - ftag_add_one_file(db, next_id, argv[i]); - next_id++; + ftag_add_one_file(db, &next_id, argv[i]); } sqlite3_close(db); } -- cgit v1.2.3