From ab1b7eacd7043d5ea5bb0d4c58cd1c9a371c21e4 Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Mon, 18 Sep 2006 08:53:02 +0000 Subject: added test on warning time interval in config_notify_bar(), plus small bugfixes --- src/calcurse.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calcurse.c b/src/calcurse.c index c964a5f..ca847de 100755 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -1,4 +1,4 @@ -/* $calcurse: calcurse.c,v 1.20 2006/09/17 10:43:54 culot Exp $ */ +/* $calcurse: calcurse.c,v 1.21 2006/09/18 08:53:02 culot Exp $ */ /* * Calcurse - text-based organizer @@ -216,7 +216,7 @@ int main(int argc, char **argv) /* Get user input. */ ch = wgetch(swin); - switch (ch) { + if (ch != 10) switch (ch) { case 9: /* The TAB key was hit. */ reset_status_page(); @@ -849,7 +849,8 @@ void config_notify_bar(void) case '4': status_mesg(count_str, ""); getstring(swin, colr, buf, 0, 1); - if (strlen(buf) != 0) { + if (strlen(buf) != 0 && is_all_digit(buf) && + atoi(buf) >= 0 && atoi(buf) <= DAYINSEC) { pthread_mutex_lock(&nbar->mutex); nbar->cntdwn = atoi(buf); pthread_mutex_unlock(&nbar->mutex); @@ -873,7 +874,7 @@ void print_general_options(WINDOW *win) char *option6 = _("week_begins_on_monday = "); x_pos = 3; - y_pos = 4; + y_pos = 3; mvwprintw(win, y_pos, x_pos, "[1] %s ", option1); print_option_incolor(win, auto_save, y_pos, -- cgit v1.2.3-70-g09d2