diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit 33458cd2cc9de070c330d8b922e8447e6c7b71c8
parent f65773309a51faead6b054ac22e98dc63524e760
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Mon,  1 Nov 2021 07:53:11 +0100

mv declaration out of loop (C99)

Diffstat:
Msrc/import.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/import.c b/src/import.c @@ -32,6 +32,7 @@ void ics_import(const char* ics_input, WINDOW* header, WINDOW* cal, WINDOW* asid // find all VEVENTs and write to files char *i = ics; + char* j; while (i < ics + ics_bytes) { vevent = extract_ical_field(i, "BEGIN:VEVENT", &search_pos, false); vevent_date = extract_ical_field(i, "DTSTART", &search_pos, false); @@ -78,7 +79,7 @@ void ics_import(const char* ics_input, WINDOW* header, WINDOW* cal, WINDOW* asid if (cursordate_file == NULL) { perror("Failed to open import date file"); } else { - for (char* j = vevent_desc; *j != '\0'; j++) { + for (j = vevent_desc; *j != '\0'; j++) { if (vevent_desc[j-vevent_desc] == 0x5C) { // backslash switch (*(j+1)) { case 'n':