From e6099b2d59dfed9f7419f516e09952005f283dd5 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Sat, 1 Jun 2019 20:34:08 +0200 Subject: Fix recurrent appointment end time when duration is zero Fixes a regression introduced in 223810c (Major overhaul of appointment/event input routines., 2017-11-06) and 16d3032 (Refactoring update_duration/day_edit_duration., 2017-10-18). Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/ui-day.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ui-day.c b/src/ui-day.c index 7774764..5907490 100644 --- a/src/ui-day.c +++ b/src/ui-day.c @@ -209,15 +209,10 @@ static void update_duration(time_t *start, long *dur) unsigned newdur; char *timestr, *outstr; - if (*dur > 0) { - end = *start + *dur; - asprintf(&outstr, "%s %s", DATEFMT(conf.input_datefmt), "%H:%M"); - timestr = date_sec2date_str(end, outstr); - mem_free(outstr); - } else { - timestr = mem_strdup(""); - } - + end = *start + *dur; + asprintf(&outstr, "%s %s", DATEFMT(conf.input_datefmt), "%H:%M"); + timestr = date_sec2date_str(end, outstr); + mem_free(outstr); for (;;) { int ret, early = 0; status_mesg(msg_time, ""); -- cgit v1.2.3-70-g09d2