diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-02-01 18:14:32 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-02-01 18:14:32 +0100 |
commit | 217e66729a249a638863a9cc2ff93b8368cd6094 (patch) | |
tree | 0bb93115322a1ffbcd0549c8aa4071a05f50ba21 /src/interaction.c | |
parent | 2ea91e1a8a2ee4318e3530ec2680565ad11b1585 (diff) | |
download | calcurse-217e66729a249a638863a9cc2ff93b8368cd6094.tar.gz calcurse-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.c | 4 |
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) |