aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files 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);
}