aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-10-05 09:56:28 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-10-06 12:37:07 +0200
commita7489b916e602e3dd66b31d5bbc7956d6174806d (patch)
treea5c3fc741e783c6729c18fb19b2a56303c736f6a
parent39dd3c251db7a70b9ec013781ca74fe6fc241792 (diff)
downloadcalcurse-a7489b916e602e3dd66b31d5bbc7956d6174806d.tar.gz
calcurse-a7489b916e602e3dd66b31d5bbc7956d6174806d.zip
src/utils.c: Remove check_time()
Now that parse_time() and parse_duration() do all the validation work, this isn't used (nor needed) any longer. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/calcurse.h1
-rw-r--r--src/utils.c31
2 files changed, 0 insertions, 32 deletions
diff --git a/src/calcurse.h b/src/calcurse.h
index 5a8bfe9..a681f92 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -892,7 +892,6 @@ long date_sec_change (long, int, int);
long update_time_in_date (long, unsigned, unsigned);
long get_sec_date (struct date);
long min2sec (unsigned);
-int check_time (char *);
void draw_scrollbar (WINDOW *, int, int, int, int, int, unsigned);
void item_in_popup (char *, char *, char *, char *);
long get_today (void);
diff --git a/src/utils.c b/src/utils.c
index 510f4dd..ce4b0f7 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -387,37 +387,6 @@ min2sec (unsigned minutes)
}
/*
- * Checks if a time has a good format.
- * The format could be either HH:MM or H:MM or MM, and we should have:
- * 0 <= HH <= 24 and 0 <= MM < 999.
- * This function returns 1 if the entered time is correct and in
- * [h:mm] or [hh:mm] format, and 2 if the entered time is correct and entered
- * in [mm] format.
- */
-int
-check_time (char *string)
-{
- char *s = mem_strdup(string);
- char *hour = strtok(s, ":");
- char *min = strtok(NULL, ":");
- int h, m;
- int ret = 0;
-
- if (min)
- {
- h = atoi (hour);
- m = atoi (min);
- if (h >= 0 && h < 24 && m >= 0 && m < MININSEC)
- ret = 1;
- }
- else if (strlen(s) < 4 && is_all_digit(s) && atoi(s) > 0)
- ret = 2;
-
- mem_free(s);
- return ret;
-}
-
-/*
* Display a scroll bar when there are so many items that they
* can not be displayed inside the corresponding panel.
*/