summaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/utils.c b/src/utils.c
index da8eade..60b0278 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -97,15 +97,15 @@ void exit_calcurse(int status)
void free_user_data(void)
{
+ unsigned i;
+
day_free_list();
event_llist_free();
- event_free_bkp();
apoint_llist_free();
- apoint_free_bkp();
recur_apoint_llist_free();
recur_event_llist_free();
- recur_apoint_free_bkp();
- recur_event_free_bkp();
+ for (i = 0; i <= 37; i++)
+ interact_day_item_cut_free(i);
todo_free_list();
notify_free_app();
}
@@ -501,8 +501,8 @@ draw_scrollbar(WINDOW * win, int y, int x, int length,
* long to fit in its corresponding panel window.
*/
void
-item_in_popup(const char *saved_a_start, const char *saved_a_end,
- const char *msg, const char *pop_title)
+item_in_popup(const char *a_start, const char *a_end, const char *msg,
+ const char *pop_title)
{
WINDOW *popup_win, *pad;
const int margin_left = 4, margin_top = 4;
@@ -511,9 +511,9 @@ item_in_popup(const char *saved_a_start, const char *saved_a_end,
pad = newpad(padl, padw);
popup_win = popup(winl, winw, 1, 2, pop_title, NULL, 1);
- if (strcmp(pop_title, _("Appointment")) == 0) {
- mvwprintw(popup_win, margin_top, margin_left, "- %s -> %s",
- saved_a_start, saved_a_end);
+ if (a_start && a_end) {
+ mvwprintw(popup_win, margin_top, margin_left, "- %s -> %s", a_start,
+ a_end);
}
mvwaddstr(pad, 0, margin_left, msg);
wmove(win[STA].p, 0, 0);
@@ -751,9 +751,11 @@ int parse_time(const char *string, unsigned *hour, unsigned *minute)
if (*p == ':') {
if ((++n) > 1)
return 0;
- } else if ((*p >= '0') && (*p <= '9'))
+ } else if ((*p >= '0') && (*p <= '9')) {
+ if ((n == 0) && (p == (string + 2)) && *(p + 1))
+ n++;
in[n] = in[n] * 10 + (int)(*p - '0');
- else
+ } else
return 0;
}