aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-04-05 15:11:12 -0500
committerTed Gould <ted@gould.cx>2011-04-05 15:11:12 -0500
commitdb8896f805704ea21387cb4acd712901177e1ea3 (patch)
tree6f0358d9e5405db12954364ae599d79dabcdbe3d /src
parent9744a2f892fb78f74e9c942197ca98309a9e2759 (diff)
downloadayatana-indicator-datetime-db8896f805704ea21387cb4acd712901177e1ea3.tar.gz
ayatana-indicator-datetime-db8896f805704ea21387cb4acd712901177e1ea3.tar.bz2
ayatana-indicator-datetime-db8896f805704ea21387cb4acd712901177e1ea3.zip
Use stack memory instead of the global to avoid it getting modified
Diffstat (limited to 'src')
-rw-r--r--src/datetime-service.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index c72b061..0ceb975 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -802,9 +802,10 @@ update_appointment_menu_items (gpointer user_data)
DbusmenuMenuitem * item;
ECalComponentVType vtype = e_cal_component_get_vtype (ecalcomp);
+ struct tm due_data = {0};
struct tm *due = NULL;
- if (vtype == E_CAL_COMPONENT_EVENT) due = localtime(&ci->start);
- else if (vtype == E_CAL_COMPONENT_TODO) due = localtime(&ci->end);
+ if (vtype == E_CAL_COMPONENT_EVENT) due = localtime_r(&ci->start, &due_data);
+ else if (vtype == E_CAL_COMPONENT_TODO) due = localtime_r(&ci->end, &due_data);
else continue;
const int dmday = due->tm_mday;