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 <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2013-02-01 18:14:32 +01:00
parent 2ea91e1a8a
commit 217e66729a

View File

@ -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)