diff options
Diffstat (limited to 'calendar/gui/dialogs/comp-editor-util.c')
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index e3cf454e84..dcad6a44cf 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -93,7 +93,7 @@ static void write_label_piece (struct icaltimetype *tt, char *buffer, int size, char *stext, char *etext) { - struct tm tmp_tm; + struct tm tmp_tm = { 0 }; int len; /* FIXME: May want to convert the time to an appropriate zone. */ @@ -109,6 +109,10 @@ write_label_piece (struct icaltimetype *tt, char *buffer, int size, tmp_tm.tm_sec = tt->second; tmp_tm.tm_isdst = -1; + /* Call mktime() to set the weekday. FIXME: Don't do this. mktime() + could in theory adjust the time if it thought it was invalid. */ + mktime (&tmp_tm); + len = strlen (buffer); e_time_format_date_and_time (&tmp_tm, calendar_config_get_24_hour_format (), |