"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
icalproperty_new_method(is_reply ? ICAL_METHOD_REPLY:event->method),
- 0
+ (void*)0
);
if (!calendar) {
ievent =
icalcomponent_vanew(
- ICAL_VEVENT_COMPONENT, 0);
+ ICAL_VEVENT_COMPONENT, (void*)0);
if (!ievent) {
g_warning ("can't generate event");
static void get_rfc822_date_from_time_t(gchar *buf, gint len, time_t t)
{
+#ifndef G_OS_WIN32
struct tm *lt;
gchar day[4], mon[4];
gint dd, hh, mm, ss, yyyy;
gchar buft1[512];
struct tm buft2;
-#ifndef G_OS_WIN32
lt = localtime_r(&t, &buft2);
-#else
- if (t < 0)
- t = 1;
- lt = localtime(&t);
-#endif
-
sscanf(asctime_r(lt, buft1), "%3s %3s %d %d:%d:%d %d\n",
day, mon, &dd, &hh, &mm, &ss, &yyyy);
g_snprintf(buf, len, "%s, %d %s %d %02d:%02d:%02d %s",
day, dd, mon, yyyy, hh, mm, ss, tzoffset(&t));
+#else
+ GDateTime *dt = g_date_time_new_from_unix_local(t);
+ gchar *buf2 = g_date_time_format(dt, "%a, %e %b %Y %H:%M:%S %z");
+ g_date_time_unref(dt);
+ strncpy(buf, buf2, len);
+ g_free(buf2);
+#endif
}
static gchar *write_headers_date(const gchar *uid)
gchar date[128];
time_t t;
struct tm lt;
- struct tm buft;
memset(subject, 0, sizeof(subject));
memset(date, 0, sizeof(date));
}
#ifndef G_OS_WIN32
+ struct tm buft;
lt = *localtime_r(&t, &buft);
#else
if (t < 0)
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
icalproperty_new_method(ICAL_METHOD_PUBLISH),
- 0
+ (void*)0
);
if (!calendar) {
while (lines[i]) {
gint e_len = strlen(qpbody), n_len = 0;
gchar *outline = conv_codeset_strdup(lines[i], CS_UTF_8, conv_get_outgoing_charset_str());
- gchar buf[strlen(outline)*8];
+ gchar *qpoutline = g_malloc(strlen(outline)*8 + 1);
- qp_encode_line(buf, (guchar *)outline);
- n_len = strlen(buf);
+ qp_encode_line(qpoutline, (guchar *)outline);
+ n_len = strlen(qpoutline);
qpbody = g_realloc(qpbody, e_len + n_len + 1);
- strcpy(qpbody+e_len, buf);
+ strcpy(qpbody+e_len, qpoutline);
*(qpbody+n_len+e_len) = '\0';
g_free(outline);
+ g_free(qpoutline);
i++;
}
if (dtend && *(dtend)) {
time_t tmp = icaltime_as_timet((icaltime_from_string(dtend)));
+#ifdef G_OS_WIN32
+ GDateTime *dt = g_date_time_new_from_unix_local(tmp);
+ event->end = g_date_time_format(dt, "%a, %e %b %Y %H:%M:%S %z");
+ g_date_time_unref(dt);
+#else
gchar buft[512];
tzset();
event->end = g_strdup(ctime_r(&tmp, buft));
+#endif
}
if (dtstart && *(dtstart)) {
time_t tmp = icaltime_as_timet((icaltime_from_string(dtstart)));
+#ifdef G_OS_WIN32
+ GDateTime *dt = g_date_time_new_from_unix_local(tmp);
+ event->start = g_date_time_format(dt, "%a, %e %b %Y %H:%M:%S %z");
+ g_date_time_unref(dt);
+#else
gchar buft[512];
tzset();
event->start = g_strdup(ctime_r(&tmp, buft));
+#endif
}
event->dtstart = g_strdup(dtstart?dtstart:"");
event->dtend = g_strdup(dtend?dtend:"");
struct tm evtstart, today;
time_t evtstart_t, today_t;
struct icaltimetype itt;
- struct tm buft;
tzset();
}
#ifndef G_OS_WIN32
+ struct tm buft;
today = *localtime_r(&today_t, &buft);
localtime_r(&evtstart_t, &evtstart);
#else