"-//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");
+ strncpy(buf, buf2, len);
+ g_free(buf2);
+#endif
}
static gchar *write_headers_date(const gchar *uid)
t = time(NULL) + (86400*7);
t_subject = _("Later");
} else {
- g_warning("unknown spec date\n");
+ g_warning("unknown spec date");
return NULL;
}
"-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
icalproperty_new_calscale("GREGORIAN"),
icalproperty_new_method(ICAL_METHOD_PUBLISH),
- 0
+ (void*)0
);
if (!calendar) {
/* encode to quoted-printable */
while (lines[i]) {
- gchar buf[256];
gint e_len = strlen(qpbody), n_len = 0;
gchar *outline = conv_codeset_strdup(lines[i], CS_UTF_8, conv_get_outgoing_charset_str());
+ 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++;
}
xml_tag_add_attr(tag, xml_attr_new("type", tmp));
g_free(tmp);
- tmp = g_strdup_printf("%lu", event->postponed);
+ tmp = g_strdup_printf("%lld", (long long)event->postponed);
xml_tag_add_attr(tag, xml_attr_new("postponed", tmp));
g_free(tmp);
xml_free_tree(rootnode);
if (prefs_file_close(pfile) < 0) {
- g_warning("failed to write event.\n");
+ g_warning("failed to write event.");
return;
}
xmlnode = node->data;
if (strcmp2(xmlnode->tag->tag, "event") != 0) {
- g_warning("tag name != \"event\"\n");
+ g_warning("tag name != \"event\"");
return NULL;
}
xmlnode = node->data;
if (strcmp2(xmlnode->tag->tag, "answer") != 0) {
- g_warning("tag name != \"answer\"\n");
+ g_warning("tag name != \"answer\"");
return event;
}
list = xmlnode->tag->attr;
g_free(path);
if (!node) {
- g_warning("no node\n");
+ g_warning("no node");
return NULL;
}
folderitem = account_get_special_folder(account, F_QUEUE);
if (!folderitem) {
- g_warning("can't find queue folder for %s\n", account->address);
+ g_warning("can't find queue folder for %s", account->address);
g_unlink(tmpfile);
g_free(tmpfile);
return FALSE;
folder_item_scan(folderitem);
if ((msgnum = folder_item_add_msg(folderitem, tmpfile, NULL, TRUE)) < 0) {
- g_warning("can't queue the message\n");
+ g_warning("can't queue the message");
g_unlink(tmpfile);
g_free(tmpfile);
return FALSE;