which is way more than what RFC822 says: 37 max) and specific buffers.
#define BUFFSIZE 8192
+#define RFC822_DATE_BUFFSIZE 128
+
#ifndef MAXPATHLEN
# define MAXPATHLEN 4095
#endif
gchar day[4], mon[4];
gint dd, hh, mm, ss, yyyy;
struct tm buf1;
- gchar buf2[BUFFSIZE];
+ gchar buf2[RFC822_DATE_BUFFSIZE];
t = time(NULL);
lt = localtime_r(&t, &buf1);
static gint compose_redirect_write_headers(Compose *compose, FILE *fp)
{
+ gchar date[RFC822_DATE_BUFFSIZE];
gchar buf[BUFFSIZE];
gchar *str;
const gchar *entstr;
/* Resent-Date */
if (prefs_common.hide_timezone)
- get_rfc822_date_hide_tz(buf, sizeof(buf));
+ get_rfc822_date_hide_tz(date, sizeof(date));
else
- get_rfc822_date(buf, sizeof(buf));
+ get_rfc822_date(date, sizeof(date));
err |= (fprintf(fp, "Resent-Date: %s\n", buf) < 0);
/* Resent-From */
static gchar *compose_get_header(Compose *compose)
{
+ gchar date[RFC822_DATE_BUFFSIZE];
gchar buf[BUFFSIZE];
const gchar *entry_str;
gchar *str;
/* Date */
if (prefs_common.hide_timezone)
- get_rfc822_date_hide_tz(buf, sizeof(buf));
+ get_rfc822_date_hide_tz(date, sizeof(date));
else
- get_rfc822_date(buf, sizeof(buf));
- g_string_append_printf(header, "Date: %s\n", buf);
+ get_rfc822_date(date, sizeof(date));
+ g_string_append_printf(header, "Date: %s\n", date);
/* From */
{
MsgInfo *newmsginfo;
GSList *list;
- gchar buf[BUFFSIZE];
+ gchar date[RFC822_DATE_BUFFSIZE];
cm_return_val_if_fail( compose != NULL, NULL );
newmsginfo = procmsg_msginfo_new();
/* date is now */
- get_rfc822_date(buf, sizeof(buf));
- newmsginfo->date = g_strdup(buf);
+ get_rfc822_date(date, sizeof(date));
+ newmsginfo->date = g_strdup(date);
/* from */
if (compose->from_name) {
gchar *foo = NULL;
gboolean queued_removed = FALSE;
gchar *boundary = NULL;
- gchar buf_date[BUFFSIZE];
+ gchar buf_date[RFC822_DATE_BUFFSIZE];
gchar *date = NULL;
gchar *orig_to = NULL;
gchar *enc_sub = NULL;
msginfo->inreplyto = g_strdup(p);
}
g_free(tmp);
- }
+ }
return msginfo;
}
{
gchar * tmp;
FILE * tmpfp;
- gchar buf[BUFFSIZE];
+ gchar date[RFC822_DATE_BUFFSIZE];
tmp = g_strdup_printf("%s%ccancel%p", get_tmp_dir(),
G_DIR_SEPARATOR, msginfo);
}
if (prefs_common.hide_timezone)
- get_rfc822_date_hide_tz(buf, sizeof(buf));
+ get_rfc822_date_hide_tz(date, sizeof(date));
else
- get_rfc822_date(buf, sizeof(buf));
+ get_rfc822_date(date, sizeof(date));
if (fprintf(tmpfp, "From: %s\r\n"
"Newsgroups: %s\r\n"
"Subject: cmsg cancel <%s>\r\n"
msginfo->msgid,
msginfo->from,
msginfo->from,
- buf) < 0) {
+ date) < 0) {
FILE_OP_ERROR(tmp, "fprintf");
fclose(tmpfp);
claws_unlink(tmp);
static FetchinfoConfig config;
static PrefParam param[] = {
- {"fetchinfo_enable", "FALSE", &config.fetchinfo_enable,
- P_BOOL, NULL, NULL, NULL},
- {"fetchinfo_uidl", "TRUE", &config.fetchinfo_uidl,
- P_BOOL, NULL, NULL, NULL},
- {"fetchinfo_account", "TRUE", &config.fetchinfo_account,
- P_BOOL, NULL, NULL, NULL},
- {"fetchinfo_server", "TRUE", &config.fetchinfo_server,
- P_BOOL, NULL, NULL, NULL},
- {"fetchinfo_userid", "TRUE", &config.fetchinfo_userid,
- P_BOOL, NULL, NULL, NULL},
- {"fetchinfo_time", "TRUE", &config.fetchinfo_time,
- P_BOOL, NULL, NULL, NULL},
+ {"fetchinfo_enable", "FALSE", &config.fetchinfo_enable, P_BOOL, NULL, NULL, NULL},
+ {"fetchinfo_uidl", "TRUE", &config.fetchinfo_uidl, P_BOOL, NULL, NULL, NULL},
+ {"fetchinfo_account", "TRUE", &config.fetchinfo_account, P_BOOL, NULL, NULL, NULL},
+ {"fetchinfo_server", "TRUE", &config.fetchinfo_server, P_BOOL, NULL, NULL, NULL},
+ {"fetchinfo_userid", "TRUE", &config.fetchinfo_userid, P_BOOL, NULL, NULL, NULL},
+ {"fetchinfo_time", "TRUE", &config.fetchinfo_time, P_BOOL, NULL, NULL, NULL},
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
};
Pop3Session *session;
gchar *newheaders;
gchar *newdata;
- gchar date[PREFSBUFSIZE];
+ gchar date[RFC822_DATE_BUFFSIZE];
if (!config.fetchinfo_enable) {
return FALSE;
FALSE );
session = mail_receive_data->session;
- get_rfc822_date(date, PREFSBUFSIZE);
+ get_rfc822_date(date, sizeof(date));
newheaders = g_strdup("");
if (config.fetchinfo_uidl)
#include "folder.h"
#include "quoted-printable.h"
#include "utils.h"
+#include "defs.h"
#ifdef G_OS_WIN32
#define getuid() 0
{
gchar subject[512];
gchar *t_subject;
- gchar date[128];
+ gchar date[RFC822_DATE_BUFFSIZE];
time_t t;
struct tm lt;
gboolean is_pseudo_display)
{
gchar *subject = NULL;
- gchar date[128];
+ gchar date[RFC822_DATE_BUFFSIZE];
gchar *save_folder = NULL;
gchar *result = NULL;
gchar *queue_headers = NULL;
gchar *orga)
{
gchar subject[512];
- gchar date[128];
+ gchar date[RFC822_DATE_BUFFSIZE];
gchar *result = NULL;
gchar *method_str = NULL;
gchar *summary = NULL;
static void write_welcome_email(WizardWindow *wizard)
{
- gchar buf_date[64];
+ gchar date[RFC822_DATE_BUFFSIZE];
gchar *head=NULL;
gchar *body=NULL;
gchar *msg=NULL;
gchar *file = get_tmp_file();
gchar enc_from_name[BUFFSIZE], enc_to_name[BUFFSIZE], enc_subject[BUFFSIZE];
- get_rfc822_date(buf_date, sizeof(buf_date));
+ get_rfc822_date(date, sizeof(date));
conv_encode_header_full(enc_subject, sizeof(enc_subject),
C_("Welcome Mail Subject", "Welcome to Claws Mail"),
USERS_ML_ADDR,
enc_to_name,
gtk_entry_get_text(GTK_ENTRY(wizard->email)),
- buf_date, enc_subject, XFACE, FACE);
+ date, enc_subject, XFACE, FACE);
body = g_strdup_printf(
_("\n"
"Welcome to Claws Mail\n"