From bcdfd5d893818bba15f7f616e5f255e2fafed7ed Mon Sep 17 00:00:00 2001 From: El-BG-1970 Date: Fri, 22 Oct 2021 15:10:56 +0200 Subject: fixed issue where agenda entries could not have colons --- agenda_entry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'agenda_entry.c') diff --git a/agenda_entry.c b/agenda_entry.c index fa933c6..91a23b9 100644 --- a/agenda_entry.c +++ b/agenda_entry.c @@ -1,3 +1,4 @@ +#include "utils.h" #include "agenda_entry.h" char *next_word(char *str) { return strstr(str, " ")+1; } @@ -24,7 +25,7 @@ entry read_agenda_entry(char *agenda) { //find out if there is a tag, and extract it lookahead = strstr(cursor, ":\n"); if (lookahead && (lookahead < nextentry)) { - tmp = strstr(cursor, ":"); + tmp = rstrchr(cursor, lookahead-1, ':'); agenda_entry.tag = (char *)malloc(lookahead - tmp); strncpy(agenda_entry.tag, tmp+1, lookahead - tmp - 1); agenda_entry.tag[lookahead - tmp - 1] = '\0'; // here we're actually modifying lookahead-tmp cause the array is zero indexed -- cgit v1.2.3