summaryrefslogtreecommitdiff
path: root/src/interaction.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2013-02-01 18:14:32 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2013-02-01 18:14:32 +0100
commit217e66729a249a638863a9cc2ff93b8368cd6094 (patch)
tree0bb93115322a1ffbcd0549c8aa4071a05f50ba21 /src/interaction.c
parent2ea91e1a8a2ee4318e3530ec2680565ad11b1585 (diff)
downloadcalcurse-217e66729a249a638863a9cc2ff93b8368cd6094.zip
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>
Diffstat (limited to 'src/interaction.c')
-rw-r--r--src/interaction.c4
1 files changed, 2 insertions, 2 deletions
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)