From fa353e5eb79a352ae5f5fe199f16c75b30ce3563 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Sat, 9 Dec 2017 23:53:20 +0100 Subject: Buffer mixup Use one (small) buffer long enough to hold a date. Signed-off-by: Lukas Fleischer --- src/ui-day.c | 7 +++---- 1 file 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 == '?') { -- cgit v1.2.3-70-g09d2