X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fcalendar_tools.c;h=5b34a88c1d88f10070bacd6e895ce916d50d0e3c;hb=a8b82e22f5f615718d726335fb28eee4513365f7;hp=bea5fc10933e27fec9b5e24b918e542663615dd2;hpb=c7209f051c44912da2e367e984a8c8660b9139d2;p=citadel.git diff --git a/webcit/calendar_tools.c b/webcit/calendar_tools.c index bea5fc109..5b34a88c1 100644 --- a/webcit/calendar_tools.c +++ b/webcit/calendar_tools.c @@ -74,17 +74,17 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) { int all_day_event = 0; now = time(NULL); - memcpy(&tm_now, localtime(&now), sizeof(struct tm)); + localtime_r(&now, &tm_now); this_year = tm_now.tm_year + 1900; if (t == NULL) return; if (t->is_date) all_day_event = 1; tt = icaltime_as_timet(*t); if (all_day_event) { - memcpy(&tm, gmtime(&tt), sizeof(struct tm)); + gmtime_r(&tt, &tm); } else { - memcpy(&tm, localtime(&tt), sizeof(struct tm)); + localtime_r(&tt, &tm); } wprintf("Month: "); @@ -157,7 +157,7 @@ struct icaltimetype icaltime_from_webform(char *prefix) { char vname[SIZ]; tt = time(NULL); - memcpy(&tm, localtime(&tt), sizeof(struct tm)); + localtime_r(&tt, &tm); sprintf(vname, "%s_month", prefix); tm.tm_mon = atoi(bstr(vname)) - 1; sprintf(vname, "%s_day", prefix); tm.tm_mday = atoi(bstr(vname));