summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2006-10-28 10:34:33 +0000
committerFrederic Culot <calcurse@culot.org>2006-10-28 10:34:33 +0000
commit295ca065cce80df3cc9c96c8b050643ca83af961 (patch)
tree9b4a4fbf9f1bc4074947dc6c53dc4455d43a802d /src
parentf24d66497d05d831d41a5b558c71230cec821da4 (diff)
downloadcalcurse-295ca065cce80df3cc9c96c8b050643ca83af961.tar.gz
calcurse-295ca065cce80df3cc9c96c8b050643ca83af961.zip
getstring() call in recur_repeat_item() updated
Diffstat (limited to 'src')
-rwxr-xr-xsrc/recur.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/recur.c b/src/recur.c
index 2463d5f..6b87d59 100755
--- a/src/recur.c
+++ b/src/recur.c
@@ -1,4 +1,4 @@
-/* $calcurse: recur.c,v 1.14 2006/10/16 13:33:44 culot Exp $ */
+/* $calcurse: recur.c,v 1.15 2006/10/28 10:34:33 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -517,7 +517,7 @@ void recur_repeat_item(int sel_year, int sel_month, int sel_day,
int ch = 0;
int valid_date = 0, date_entered = 0;
int year = 0, month = 0, day = 0;
- char user_input[MAX_LENGTH];
+ char user_input[MAX_LENGTH] = "";
char *mesg_type_1 =
_("Enter the repetition type: (D)aily, (W)eekly, (M)onthly, (Y)early");
char *mesg_type_2 = _("[D/W/M/Y] ");
@@ -562,8 +562,7 @@ void recur_repeat_item(int sel_year, int sel_month, int sel_day,
while (freq == 0) {
status_mesg(mesg_freq_1, "");
- getstring(swin, colr, user_input, 0, 1);
- if (strlen(user_input) != 0) {
+ if (getstring(swin, colr, user_input, 0, 1) == 0) {
freq = atoi(user_input);
if (freq == 0) {
status_mesg(mesg_wrong_freq, wrong_type_2);
@@ -577,8 +576,7 @@ void recur_repeat_item(int sel_year, int sel_month, int sel_day,
while (!date_entered) {
status_mesg(mesg_until_1, "");
- getstring(swin, colr, user_input, 0, 1);
- if (strlen(user_input) != 0) {
+ if (getstring(swin, colr, user_input, 0, 1) == 0) {
if (strlen(user_input) == 1 &&
strncmp(user_input, "0", 1) == 0 ) {
until = 0;