From 2d664cc4e151f03053982d3075239bfa1aaea41e Mon Sep 17 00:00:00 2001 From: Oskar Date: Sun, 30 Jun 2024 13:13:10 +0200 Subject: fixed bug where ID starts at 2 if log directory is empty --- trashsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trashsys.c b/trashsys.c index f8d081f..77156a4 100644 --- a/trashsys.c +++ b/trashsys.c @@ -251,7 +251,7 @@ int check_create_ts_dirs(struct initial_path_info *ipi) { // 1. Check if trashsy uint64_t find_highest_id (struct initial_path_info *ipi) { // Find highest id and then return it, because we will create the new log entry as highestID + 1 // We need to check whether a file is a directory or just a file. - uint64_t id = 1; + uint64_t id = 0; struct dirent *ddd; DIR *dir = opendir(ipi->ts_path_log); if (dir == NULL) { -- cgit v1.2.3