aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2017-12-09 23:53:20 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2018-08-25 10:15:33 +0200
commitfa353e5eb79a352ae5f5fe199f16c75b30ce3563 (patch)
tree54bc34df38e91fb27a6cfb1cb8a0e1775ea19b23
parent223810cf0e8d4f4458fe1f928c31ed11f95818c6 (diff)
downloadcalcurse-fa353e5eb79a352ae5f5fe199f16c75b30ce3563.tar.gz
calcurse-fa353e5eb79a352ae5f5fe199f16c75b30ce3563.zip
Buffer mixup
Use one (small) buffer long enough to hold a date. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
-rw-r--r--src/ui-day.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ui-day.c b/src/ui-day.c
index 1a485f6..1457203 100644
--- a/src/ui-day.c
+++ b/src/ui-day.c
@@ -540,8 +540,7 @@ void ui_day_item_pipe(void)
*/
void ui_day_item_add(void)
{
-#define LTIME 16
-#define LDUR 12
+#define LTIME 17
const char *mesg_1 =
_("Enter start time ([hh:mm] or [hhmm]), leave blank for an all-day event:");
const char *mesg_2 =
@@ -555,7 +554,7 @@ void ui_day_item_add(void)
const char *format_message_2 = _("Invalid time or duration.");
const char *format_message_3 = _("Invalid date: end time must come after start time.");
const char *enter_str = _("Press [Enter] to continue");
- char item_time[LDUR] = "";
+ char item_time[LTIME] = "";
char item_mesg[BUFSIZ] = "";
time_t start = date2sec(*ui_calendar_get_slctd_day(), 0, 0), end, saved = start;
unsigned dur;
@@ -592,7 +591,7 @@ void ui_day_item_add(void)
for (;;) {
int early = 0;
status_mesg(mesg_2, "");
- if (getstring(win[STA].p, item_time, LDUR, 0, 1) ==
+ if (getstring(win[STA].p, item_time, LTIME, 0, 1) ==
GETSTRING_ESC)
return;
if (*item_time == '?') {