From 8b39e317068d9a1e086bd6e5b0aa8d2dd471d567 Mon Sep 17 00:00:00 2001 From: Tomas Rivera <137088692+Totorile1@users.noreply.github.com> Date: Sat, 4 Apr 2026 10:48:21 +0200 Subject: [PATCH] Corrected bug where divided journal overwrote today's entry --- src/notes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/notes.c b/src/notes.c index b007cb3..30c6f3a 100644 --- a/src/notes.c +++ b/src/notes.c @@ -192,9 +192,8 @@ char *updateJournal(char *path, char *journal, char *timeFormat, int shouldDebug error(strlen(path)+1+strlen(dateWithExtension)+1>PATH_MAX, "Error file path too long. %s/%s must not exceed PATH_MAX", path, dateWithExtension); snprintf(temp, PATH_MAX, "%s/%s", path, dateWithExtension); strncpy(path, temp, PATH_MAX); - if (!isStringInArray(date, (const char **)entryArray, entryCount)) { // it only creates it if it doesn't already exist + if (!isStringInArray(dateWithExtension, (const char **)entryArray, entryCount)) { // it only creates it if it doesn't already exist // if it does exist it will just pass the full path - debug("Creating entry %s inside %s", date, path); FILE *file; file = fopen(path, "w");