WHERE char *SmimeDefaultKey;
WHERE char *SmimeCryptAlg;
-#ifdef MAIN_C
-const char *Months[] =
- { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
-"Nov", "Dec", "ERR" };
-#else
-extern const char *Months[];
-#endif
-
#endif /* !_GLOBALS_H */
char file[_POSIX_PATH_MAX];
FILE *f;
HEADER *h;
- struct tm *tm;
int i = 0, save = SORT_ORDER;
int prev = 0;
i = ctx->msgcount - NntpContext;
for (; i < ctx->msgcount; i++) {
if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->article_num != prev) {
+ char *loc;
h = ctx->hdrs[i];
addr[0] = 0;
rfc822_addrcat(addr, sizeof(addr), h->env->from, 0);
- tm = gmtime (&h->date_sent);
- snprintf (buf, sizeof (buf),
- "%d\t%s\t%s\t%d %s %d %02d:%02d:%02d GMT\t%s\t",
- h->article_num, h->env->subject, addr, tm->tm_mday,
- Months[tm->tm_mon], tm->tm_year + 1900, tm->tm_hour,
- tm->tm_min, tm->tm_sec, h->env->message_id);
- fputs (buf, f);
+
+ loc = setlocale(LC_TIME, "C");
+ strftime(buf, sizeof(buf), "%d %b %Y %H:%M:%S GMT", gmtime(&h->date_sent));
+ setlocale(LC_TIME, loc);
+
+ fprintf(f, "%d\t%s\t%s\t%s\t%s\t\n", h->article_num, h->env->subject,
+ addr, buf, h->env->message_id);
if (h->env->references)
mutt_write_references (h->env->references, f);
- snprintf (buf, sizeof (buf), "\t%zd\t%d\tXref: %s\n",
- h->content->length, h->lines, NONULL (h->env->xref));
- if (fputs (buf, f) == EOF) {
+ if (fprintf(f, "\t%zd\t%d\tXref: %s\n", h->content->length, h->lines,
+ NONULL(h->env->xref)) == EOF)
+ {
m_fclose(&f);
unlink (file);
return -1;