summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2006-10-28 10:35:55 +0000
committerFrederic Culot <calcurse@culot.org>2006-10-28 10:35:55 +0000
commit0cfe1182f6501b088f52b8a6414b6abc2f15dedc (patch)
treeb9d48a33283ea06796958a483d1bd31dbc52430f
parent295ca065cce80df3cc9c96c8b050643ca83af961 (diff)
downloadcalcurse-0cfe1182f6501b088f52b8a6414b6abc2f15dedc.tar.gz
calcurse-0cfe1182f6501b088f52b8a6414b6abc2f15dedc.zip
getstring() call in todo_new_item() updated
-rwxr-xr-xsrc/todo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/todo.c b/src/todo.c
index 3337187..d614acd 100755
--- a/src/todo.c
+++ b/src/todo.c
@@ -1,4 +1,4 @@
-/* $calcurse: todo.c,v 1.4 2006/09/02 09:20:35 culot Exp $ */
+/* $calcurse: todo.c,v 1.5 2006/10/28 10:35:55 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -42,11 +42,10 @@ int todo_new_item(int total, int colr)
char *mesg = _("Enter the new ToDo item : ");
char *mesg_id =
_("Enter the ToDo priority [1 (highest) - 9 (lowest)] :");
- char todo_input[MAX_LENGTH];
+ char todo_input[MAX_LENGTH] = "";
status_mesg(mesg, "");
- getstring(swin, colr, todo_input, 0, 1);
- if (strlen(todo_input) != 0) {
+ if (getstring(swin, colr, todo_input, 0, 1) == 0) {
while ( (ch < '1') || (ch > '9') ) {
status_mesg(mesg_id, "");
ch = wgetch(swin);