agendafs

A filesystem for your calendar.

git clone git://mccd.space/agendafs
commit 84c07426a0268fe5b2b10d3c2cda34501c537887
parent 92da920839dd1da8652b0c143e94a184e44ed628
Author: Marc Coquand <marc@coquand.email>
Date:   Sun,  1 Jun 2025 15:31:57 +0100

more cleanup

Diffstat:
Mmain.c | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/main.c b/main.c
@@ -238,8 +238,7 @@ static char *escape_text(const char *src)
 	}
 
 	*dst = '\0';
-	size_t actual_len = strlen(escaped);
-
+	size_t actual_len = strlen(escaped) + 1;
 	return realloc(escaped, actual_len);
 }
 
@@ -638,10 +637,8 @@ unlock_and_return:
 
 char *journal_entry_to_ical(const journal_entry *entry)
 {
-	char *escaped_summary =
-	    escape_text(entry->summary ? entry->summary : "");
-	char *escaped_description =
-	    escape_text(entry->description ? entry->description : "");
+	char *escaped_summary = escape_text(entry->summary);
+	char *escaped_description = escape_text(entry->description);
 
 	if (!escaped_summary || !escaped_description) {
 		free(escaped_summary);