From 217e66729a249a638863a9cc2ff93b8368cd6094 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 1 Feb 2013 18:14:32 +0100 Subject: Skip duration update if the prompt is canceled Do not update an appointment's duration if the user cancels the prompt at day_edit_duration(). Note that day_edit_duration() does not touch the buffer if the prompt was canceled or an invalid value was entered, resulting in the buffer variable being uninitialized in these cases. Signed-off-by: Lukas Fleischer --- src/interaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/interaction.c') diff --git a/src/interaction.c b/src/interaction.c index d048239..25b2806 100644 --- a/src/interaction.c +++ b/src/interaction.c @@ -126,8 +126,8 @@ static void update_duration(long *start, long *dur) { unsigned newdur; - day_edit_duration(*start, *dur, &newdur); - *dur = newdur; + if (day_edit_duration(*start, *dur, &newdur)) + *dur = newdur; } static void update_desc(char **desc) -- cgit v1.2.3-54-g00ecf