int t = -1;
int i;
bool done = false;
- char helpstr[LONG_STRING];
+ char helpstr[1024];
int omax;
*/
static bool string_is_address(const char *str, const char *u, const char *d)
{
- char buf[LONG_STRING];
+ char buf[1024];
snprintf(buf, sizeof(buf), "%s@%s", NONULL(u), NONULL(d));
if (mutt_str_strcasecmp(str, buf) == 0)
void mutt_alias_create(struct Envelope *cur, struct Address *iaddr)
{
struct Alias *new = NULL;
- char buf[LONG_STRING], tmp[LONG_STRING], prompt[128], *pc = NULL;
+ char buf[1024], tmp[1024], prompt[128], *pc = NULL;
char *err = NULL;
- char fixed[LONG_STRING];
+ char fixed[1024];
FILE *rc = NULL;
struct Address *addr = NULL;
{
char buf[PATH_MAX];
char prefix[PATH_MAX] = "";
- char helpstr[LONG_STRING];
+ char helpstr[1024];
char title[256];
struct BrowserState state = { 0 };
struct Menu *menu = NULL;
tmp = new_color_line();
if (is_index)
{
- char buf[LONG_STRING];
+ char buf[1024];
mutt_str_strfcpy(buf, s, sizeof(buf));
mutt_check_simple(buf, sizeof(buf), NONULL(C_SimpleSearch));
tmp->color_pattern = mutt_pattern_comp(buf, MUTT_FULL_MSG, err);
*/
int mutt_display_message(struct Email *cur)
{
- char tempfile[PATH_MAX], buf[LONG_STRING];
+ char tempfile[PATH_MAX], buf[1024];
int rc = 0;
bool builtin = false;
int cmflags = MUTT_CM_DECODE | MUTT_CM_DISPLAY | MUTT_CM_CHARCONV;
if (!m || !el)
return;
- char buffer[LONG_STRING] = { 0 };
+ char buffer[1024] = { 0 };
if ((mutt_get_field(_("Pipe to command: "), buffer, sizeof(buffer), MUTT_CMD) != 0) ||
(buffer[0] == '\0'))
*/
void mutt_shell_escape(void)
{
- char buf[LONG_STRING];
+ char buf[1024];
buf[0] = '\0';
if (mutt_get_field(_("Shell command: "), buf, sizeof(buf), MUTT_CMD) != 0)
*/
void mutt_enter_command(void)
{
- char buffer[LONG_STRING] = { 0 };
+ char buffer[1024] = { 0 };
/* if enter is pressed after : with no command, just return */
if (mutt_get_field(":", buffer, sizeof(buffer), MUTT_COMMAND) != 0 || !buffer[0])
*/
int mutt_edit_content_type(struct Email *e, struct Body *b, FILE *fp)
{
- char buf[LONG_STRING];
- char obuf[LONG_STRING];
+ char buf[1024];
+ char obuf[1024];
char tmp[256];
char charset[256];
*/
static void draw_envelope_addr(int line, struct Address *addr)
{
- char buf[LONG_STRING];
+ char buf[1024];
buf[0] = '\0';
mutt_addr_write(buf, sizeof(buf), addr, true);
if (menu->redraw & REDRAW_STATUS)
{
- char buf[LONG_STRING];
+ char buf[1024];
compose_status_line(buf, sizeof(buf), 0, MuttStatusWindow->cols, menu,
NONULL(C_ComposeFormat));
mutt_window_move(MuttStatusWindow, 0, 0);
*/
int mutt_compose_menu(struct Email *msg, char *fcc, size_t fcclen, struct Email *cur, int flags)
{
- char helpstr[LONG_STRING]; // This isn't copied by the help bar
+ char helpstr[1024]; // This isn't copied by the help bar
char buf[PATH_MAX];
int op_close = OP_NULL;
int rc = -1;
struct ConnAccount account;
unsigned int ssf; /**< security strength factor, in bits */
- char inbuf[LONG_STRING];
+ char inbuf[1024];
int bufpos;
int fd;
};
X509_NAME *x509_subject = NULL;
X509_NAME *x509_issuer = NULL;
- char helpstr[LONG_STRING];
+ char helpstr[1024];
char buf[256];
char title[256];
struct Menu *menu = mutt_menu_new(MENU_GENERIC);
time_t t;
char datestr[30];
struct Menu *menu = NULL;
- char helpstr[LONG_STRING];
+ char helpstr[1024];
char title[256];
FILE *fp = NULL;
gnutls_datum_t pemdata;
bool from = false;
bool this_is_from = false;
bool ignore = false;
- char buf[LONG_STRING]; /* should be long enough to get most fields in one pass */
+ char buf[1024]; /* should be long enough to get most fields in one pass */
char *nl = NULL;
char **headers = NULL;
int hdr_count;
char *folder = nm_email_get_folder(e);
if (folder && !(C_Weed && mutt_matches_ignore("folder")))
{
- char buf[LONG_STRING];
+ char buf[1024];
mutt_str_strfcpy(buf, folder, sizeof(buf));
mutt_pretty_mailbox(buf, sizeof(buf));
*/
static char **be_snarf_file(const char *path, char **buf, int *max, int *len, bool verbose)
{
- char tmp[LONG_STRING];
+ char tmp[1024];
struct stat sb;
FILE *f = fopen(path, "r");
{
int n;
// int offset, bytes;
- char tmp[LONG_STRING];
+ char tmp[1024];
if (!msg || !buf || !bufmax || !buflen)
return buf;
{
char **buf = NULL;
int bufmax = 0, buflen = 0;
- char tmp[LONG_STRING];
+ char tmp[1024];
bool abort = false;
bool done = false;
char *p = NULL;
static const char *parse_route_addr(const char *s, char *comment, size_t *commentlen,
size_t commentmax, struct Address *addr)
{
- char token[LONG_STRING];
+ char token[1024];
size_t tokenlen = 0;
s = mutt_str_skip_email_wsp(s);
static const char *parse_addr_spec(const char *s, char *comment, size_t *commentlen,
size_t commentmax, struct Address *addr)
{
- char token[LONG_STRING];
+ char token[1024];
size_t tokenlen = 0;
s = parse_address(s, token, &tokenlen, sizeof(token) - 1, comment, commentlen,
{
int ws_pending;
const char *ps = NULL;
- char comment[LONG_STRING], phrase[LONG_STRING];
+ char comment[1024], phrase[1024];
size_t phraselen = 0, commentlen = 0;
struct Address *cur = NULL;
static void parse_parameters(struct ParameterList *param, const char *s)
{
struct Parameter *new = NULL;
- char buffer[LONG_STRING];
+ char buffer[1024];
const char *p = NULL;
size_t i;
struct Envelope *mutt_rfc822_read_header(FILE *f, struct Email *e, bool user_hdrs, bool weed)
{
struct Envelope *env = mutt_env_new();
- char *line = mutt_mem_malloc(LONG_STRING);
char *p = NULL;
LOFF_T loc;
- size_t linelen = LONG_STRING;
- char buf[LONG_STRING + 1];
+ size_t linelen = 1024;
+ char *line = mutt_mem_malloc(linelen);
+ char buf[linelen + 1];
if (e)
{
p = strpbrk(line, ": \t");
if (!p || (*p != ':'))
{
- char return_path[LONG_STRING];
+ char return_path[1024];
time_t t;
/* some bogus MTAs will quote the original "From " line */
struct Body *p = mutt_body_new();
struct Envelope *env = mutt_env_new();
char *c = NULL;
- char *line = mutt_mem_malloc(LONG_STRING);
- size_t linelen = LONG_STRING;
+ size_t linelen = 1024;
+ char *line = mutt_mem_malloc(linelen);
p->hdr_offset = ftello(fp);
*/
struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off, bool digest)
{
- char buffer[LONG_STRING];
+ char buffer[1024];
struct Body *head = NULL, *last = NULL, *new = NULL;
bool final = false; /* did we see the ending boundary? */
}
const size_t blen = mutt_str_strlen(boundary);
- while ((ftello(fp) < end_off) && fgets(buffer, LONG_STRING, fp))
+ while ((ftello(fp) < end_off) && fgets(buffer, sizeof(buffer), fp))
{
const size_t len = mutt_str_strlen(buffer);
if (mutt_str_atoi(mutt_param_get(&new->parameter, "content-lines"), &lines) < 0)
lines = 0;
for (; lines; lines--)
- if ((ftello(fp) >= end_off) || !fgets(buffer, LONG_STRING, fp))
+ if ((ftello(fp) >= end_off) || !fgets(buffer, sizeof(buffer), fp))
break;
}
#endif
/* see if more space is needed (plus extra for possible rich characters) */
if (stte->buf_len < (stte->buf_used + 3))
{
- stte->buf_len += LONG_STRING;
+ stte->buf_len += 1024;
mutt_mem_realloc(&stte->buffer, (stte->buf_len + 1) * sizeof(wchar_t));
}
if (stte->buf_len < (stte->buf_used + mutt_str_strlen(s)))
{
- stte->buf_len += LONG_STRING;
+ stte->buf_len += 1024;
mutt_mem_realloc(&stte->buffer, (stte->buf_len + 1) * sizeof(wchar_t));
}
c = s;
struct EnrichedState stte = { 0 };
wchar_t wc = 0;
int tag_len = 0;
- wchar_t tag[LONG_STRING + 1];
+ wchar_t tag[1024 + 1];
stte.s = s;
stte.wrap_margin =
enriched_set_flags(tag, &stte);
state = TEXT;
}
- else if (tag_len < LONG_STRING) /* ignore overly long tags */
+ else if (tag_len < 1024) /* ignore overly long tags */
tag[tag_len++] = wc;
else
state = BOGUS_TAG;
static bool is_mmnoask(const char *buf)
{
char *p = NULL;
- char tmp[LONG_STRING], *q = NULL;
+ char tmp[1024], *q = NULL;
const char *val = mutt_str_getenv("MM_NOASK");
if (!val)
static int autoview_handler(struct Body *a, struct State *s)
{
struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
- char buffer[LONG_STRING];
+ char buffer[1024];
char type[256];
char command[HUGE_STRING];
char tempfile[PATH_MAX] = "";
static int external_body_handler(struct Body *b, struct State *s)
{
const char *str = NULL;
- char strbuf[LONG_STRING];
+ char strbuf[1024];
const char *access_type = mutt_param_get(&b->parameter, "access-type");
if (!access_type)
unsigned long data, int flags)
{
struct HdrFormatInfo *hfi = (struct HdrFormatInfo *) data;
- char fmt[128], tmp[LONG_STRING], *p, *tags = NULL;
+ char fmt[128], tmp[1024], *p, *tags = NULL;
const char *wch = NULL;
int i;
int optional = (flags & MUTT_FORMAT_OPTIONAL);
if (split)
{
col = 0;
- col_b = LONG_STRING;
+ col_b = 1024;
fputc('\n', f);
}
else
if (split)
{
- print_macro(f, LONG_STRING, &t3);
+ print_macro(f, 1024, &t3);
fputc('\n', f);
}
else
*/
enum ImapAuthRes imap_auth_cram_md5(struct ImapAccountData *adata, const char *method)
{
- char ibuf[LONG_STRING * 2], obuf[LONG_STRING];
+ char ibuf[2048], obuf[1024];
unsigned char hmac_response[MD5_DIGEST_LEN];
int len;
int rc;
enum ImapAuthRes imap_auth_login(struct ImapAccountData *adata, const char *method)
{
char q_user[256], q_pass[256];
- char buf[LONG_STRING];
+ char buf[1024];
if ((adata->capabilities & IMAP_CAP_LOGINDISABLED))
{
mutt_message(_("Authenticating (%s)..."), mech);
- bufsize = ((olen * 2) > LONG_STRING) ? (olen * 2) : LONG_STRING;
+ bufsize = MAX((olen * 2), 1024);
buf = mutt_mem_malloc(bufsize);
snprintf(buf, bufsize, "AUTHENTICATE %s", mech);
char tmp[PATH_MAX];
char relpath[PATH_MAX];
struct ConnAccount conn_account;
- char mailbox[LONG_STRING];
+ char mailbox[1024];
if (imap_parse_path(state->folder, &conn_account, mailbox, sizeof(mailbox)))
return;
{
struct ImapAccountData *adata = NULL;
struct ImapMboxData *mdata = NULL;
- char name[LONG_STRING];
+ char name[1024];
short n;
if (imap_adata_find(path, &adata, &mdata) < 0)
{
int count = 0;
int rc;
- char buf[LONG_STRING];
+ char buf[1024];
if (!m)
return -1;
TAILQ_FOREACH(conn, mutt_socket_head(), entries)
{
struct Url url;
- char urlstr[LONG_STRING];
+ char urlstr[1024];
if (conn->account.type != MUTT_ACCT_TYPE_IMAP)
continue;
*/
int imap_create_mailbox(struct ImapAccountData *adata, char *mailbox)
{
- char buf[LONG_STRING * 2], mbox[LONG_STRING];
+ char buf[2048], mbox[1024];
imap_munge_mbox_name(adata->unicode, mbox, sizeof(mbox), mailbox);
snprintf(buf, sizeof(buf), "CREATE %s", mbox);
*/
int imap_rename_mailbox(struct ImapAccountData *adata, char *oldname, const char *newname)
{
- char oldmbox[LONG_STRING];
- char newmbox[LONG_STRING];
+ char oldmbox[1024];
+ char newmbox[1024];
int rc = 0;
imap_munge_mbox_name(adata->unicode, oldmbox, sizeof(oldmbox), oldname);
*/
int imap_open_connection(struct ImapAccountData *adata)
{
- char buf[LONG_STRING];
+ char buf[1024];
if (mutt_socket_open(adata->conn) < 0)
return -1;
if (!adata || adata->mailbox != m)
return -1;
- char flags[LONG_STRING];
+ char flags[1024];
char *tags = NULL;
char uid[11];
static int imap_status(struct ImapAccountData *adata, struct ImapMboxData *mdata, bool queue)
{
char *uid_validity_flag;
- char command[LONG_STRING * 2];
+ char command[2048];
if (!adata || !mdata)
return -1;
{
struct ImapAccountData *adata = NULL;
struct ImapMboxData *mdata = NULL;
- char buf[LONG_STRING * 2];
- char mbox[LONG_STRING];
+ char buf[2048];
+ char mbox[1024];
char errstr[256];
struct Buffer err, token;
size_t len = 0;
{
struct ImapAccountData *adata = NULL;
struct ImapMboxData *mdata = NULL;
- char tmp[LONG_STRING * 2];
+ char tmp[2048];
struct ImapList listresp;
- char completion[LONG_STRING];
+ char completion[1024];
int clen;
size_t matchlen = 0;
int completions = 0;
*/
int imap_fast_trash(struct Mailbox *m, char *dest)
{
- char prompt[LONG_STRING];
+ char prompt[1024];
int rc = -1;
bool triedcreate = false;
struct Buffer *sync_cmd = NULL;
struct ImapMboxData *mdata = imap_mdata_new(adata, url->path);
/* fixup path and realpath, mainly to replace / by /INBOX */
- char buf[LONG_STRING];
+ char buf[1024];
imap_qualify_path(buf, sizeof(buf), &adata->conn_account, mdata->name);
mutt_str_strfcpy(m->path, buf, sizeof(m->path));
mutt_str_strfcpy(m->realpath, m->path, sizeof(m->realpath));
bool store_flag_updates, bool eval_condstore)
{
struct Progress progress;
- char buf[LONG_STRING];
+ char buf[1024];
struct Mailbox *m = adata->mailbox;
struct ImapMboxData *mdata = imap_mdata_get(m);
unsigned long long hc_modseq, bool eval_qresync)
{
struct Progress progress;
- char buf[LONG_STRING];
+ char buf[1024];
unsigned int header_msn = 0;
struct Mailbox *m = adata->mailbox;
return -1;
FILE *fp = NULL;
- char buf[LONG_STRING * 2];
+ char buf[1024 * 2];
char internaldate[IMAP_DATELEN];
char imap_flags[128];
size_t len;
return -1;
struct Envelope *newenv = NULL;
- char buf[LONG_STRING];
+ char buf[1024];
char *pc = NULL;
unsigned int bytes;
struct Progress progressbar;
{
struct ConnAccount conn_account;
struct ImapAccountData *tmp_adata;
- char tmp[LONG_STRING];
+ char tmp[1024];
if (imap_parse_path(path, &conn_account, tmp, sizeof(tmp)) < 0)
return -1;
*/
struct ImapMboxData *imap_mdata_new(struct ImapAccountData *adata, const char *name)
{
- char buf[LONG_STRING];
+ char buf[1024];
struct ImapMboxData *mdata = mutt_mem_calloc(1, sizeof(struct ImapMboxData));
mdata->real_name = mutt_str_strdup(name);
{
struct ImapAccountData *adata = NULL;
struct ImapMboxData *mdata = NULL;
- char mbox[LONG_STRING];
+ char mbox[1024];
if (imap_adata_find(path, &adata, &mdata) < 0)
{
int tlen;
int hlen = 0;
bool home_match = false;
- char target_mailbox[LONG_STRING];
- char home_mailbox[LONG_STRING];
+ char target_mailbox[1024];
+ char home_mailbox[1024];
if (imap_parse_path(path, &target_conn_account, target_mailbox, sizeof(target_mailbox)) < 0)
return;
if (menu->redraw & REDRAW_STATUS)
{
- char buf[LONG_STRING];
+ char buf[1024];
menu_status_line(buf, sizeof(buf), menu, NONULL(C_StatusFormat));
mutt_window_move(MuttStatusWindow, 0, 0);
SETCOLOR(MT_COLOR_STATUS);
*/
int mutt_index_menu(void)
{
- char buf[PATH_MAX], helpstr[LONG_STRING];
+ char buf[PATH_MAX], helpstr[1024];
int flags;
int op = OP_NULL;
bool done = false; /* controls when to exit the "event" loop */
beep();
if (C_NewMailCommand)
{
- char cmd[LONG_STRING];
+ char cmd[1024];
menu_status_line(cmd, sizeof(cmd), menu, NONULL(C_NewMailCommand));
if (mutt_system(cmd) != 0)
mutt_error(_("Error running \"%s\""), cmd);
beep();
if (C_NewMailCommand)
{
- char cmd[LONG_STRING];
+ char cmd[1024];
menu_status_line(cmd, sizeof(cmd), menu, NONULL(C_NewMailCommand));
if (mutt_system(cmd) != 0)
mutt_error(_("Error running \"%s\""), cmd);
-1;
if (op == OP_TOGGLE_READ)
{
- char buf2[LONG_STRING];
+ char buf2[1024];
if (!Context->pattern || (strncmp(Context->pattern, "!~R!~D~s", 8) != 0))
{
#define NUMVARS mutt_array_size(MuttVars)
#define NUMCOMMANDS mutt_array_size(Commands)
-/* initial string that starts completion. No telling how much crap
- * the user has typed so far. Allocate LONG_STRING just to be sure! */
-static char UserTyped[LONG_STRING] = { 0 };
+/* Initial string that starts completion. No telling how much the user has
+ * typed so far. Allocate 1024 just to be sure! */
+static char UserTyped[1024] = { 0 };
static int NumMatched = 0; /* Number of matches for completion */
static char Completed[256] = { 0 }; /* completed string (command or variable) */
C_Hostname = getmailname();
if (!C_Hostname)
{
- char buffer[LONG_STRING];
+ char buffer[1024];
if (getdnsdomainname(buffer, sizeof(buffer)) == 0)
{
C_Hostname = mutt_mem_malloc(mutt_str_strlen(buffer) +
*/
int mutt_init(bool skip_sys_rc, struct ListHead *commands)
{
- char buffer[LONG_STRING];
+ char buffer[1024];
int need_pause = 0;
struct Buffer err;
if (e && (e->flagged || e->replied || e->read || e->deleted || e->old || e->maildir_flags))
{
- char tmp[LONG_STRING];
+ char tmp[1024];
snprintf(tmp, sizeof(tmp), "%s%s%s%s%s", e->flagged ? "F" : "", e->replied ? "R" : "",
e->read ? "S" : "", e->deleted ? "T" : "", NONULL(e->maildir_flags));
if (e->maildir_flags)
*/
if (!edit_infile)
{
- char buf[LONG_STRING];
+ char buf[1024];
mutt_mktemp(buf, sizeof(buf));
tempfile = mutt_str_strdup(buf);
return -1;
char buf[HUGE_STRING];
- char return_path[LONG_STRING];
+ char return_path[1024];
int count = 0;
int lines;
time_t t;
* see the message separator at *exactly* what used to be the end of the
* folder.
*/
- char buffer[LONG_STRING];
+ char buffer[1024];
if (fseeko(adata->fp, m->size, SEEK_SET) != 0)
mutt_debug(LL_DEBUG1, "#1 fseek() failed\n");
if (fgets(buffer, sizeof(buffer), adata->fp))
*/
void menu_redraw_index(struct Menu *menu)
{
- char buf[LONG_STRING];
+ char buf[1024];
bool do_color;
int attr;
*/
void menu_redraw_motion(struct Menu *menu)
{
- char buf[LONG_STRING];
+ char buf[1024];
if (menu->dialog)
{
*/
void menu_redraw_current(struct Menu *menu)
{
- char buf[LONG_STRING];
+ char buf[1024];
int attr = menu->menu_color(menu->current);
mutt_window_move(menu->indexwin, menu->current + menu->offset - menu->top, 0);
*/
static int generic_search(struct Menu *menu, regex_t *rx, int line)
{
- char buf[LONG_STRING];
+ char buf[1024];
menu_make_entry(buf, sizeof(buf), menu, line);
return regexec(rx, buf, 0, NULL, 0);
#include "config.h"
#include "base64.h"
#include "buffer.h"
+#include "memory.h"
#include "string2.h"
#define BAD -1
*/
size_t mutt_b64_buffer_encode(struct Buffer *buf, const char *in, size_t len)
{
- mutt_buffer_increase_size(buf, ((len * 2) > LONG_STRING) ? (len * 2) : LONG_STRING);
+ mutt_buffer_increase_size(buf, MAX((len * 2), 1024));
size_t num = mutt_b64_encode(in, len, buf->data, buf->dsize);
mutt_buffer_fix_dptr(buf);
return num;
mutt_mem_realloc(&BufferPool, BufferPoolLen * sizeof(struct Buffer *));
while (BufferPoolCount < 5)
{
- newbuf = mutt_buffer_alloc(LONG_STRING);
+ newbuf = mutt_buffer_alloc(1024);
BufferPool[BufferPoolCount++] = newbuf;
}
}
}
struct Buffer *buf = *pbuf;
- if (buf->dsize > (LONG_STRING * 2))
+ if (buf->dsize > 2048)
{
- buf->dsize = LONG_STRING;
+ buf->dsize = 1024;
mutt_mem_realloc(&buf->data, buf->dsize);
}
mutt_buffer_reset(buf);
*/
void mutt_ch_canonical_charset(char *buf, size_t buflen, const char *name)
{
- char in[LONG_STRING], scratch[LONG_STRING];
+ char in[1024], scratch[1024];
mutt_str_strfcpy(in, name, sizeof(in));
char *ext = strchr(in, '/');
*/
char *mutt_ch_get_langinfo_charset(void)
{
- char buf[LONG_STRING] = "";
+ char buf[1024] = "";
mutt_ch_canonical_charset(buf, sizeof(buf), nl_langinfo(CODESET));
if (dlen)
*dlen = elen;
- char canonical_buf[LONG_STRING];
+ char canonical_buf[1024];
mutt_ch_canonical_charset(canonical_buf, sizeof(canonical_buf), tocode);
mutt_str_replace(&tocode, canonical_buf);
}
bool mutt_envlist_set(const char *name, const char *value, bool overwrite)
{
char **envp = EnvList;
- char work[LONG_STRING];
+ char work[1024];
int count;
/* Look for current slot to overwrite */
int mutt_file_copy_stream(FILE *fin, FILE *fout)
{
size_t l;
- char buf[LONG_STRING];
+ char buf[1024];
while ((l = fread(buf, 1, sizeof(buf), fin)) > 0)
{
*
* @sa log_queue_set_max_size(), log_queue_flush(), log_queue_empty()
*
- * @warning Log lines are limited to #LONG_STRING bytes.
+ * @warning Log lines are limited to 1024 bytes.
*/
int log_disp_queue(time_t stamp, const char *file, int line,
const char *function, int level, ...)
{
- char buf[LONG_STRING] = "";
+ char buf[1024] = "";
int err = errno;
va_list ap;
if ((level < LL_PERROR) || (level > LL_MESSAGE))
return 0;
- char buf[LONG_STRING];
+ char buf[1024];
va_list ap;
va_start(ap, level);
*
* If 'buf' is NULL, a new string will be returned. It must be freed by the caller.
*
- * @note This function uses a fixed size buffer of LONG_STRING and so should
+ * @note This function uses a fixed size buffer of 1024 and so should
* only be used for visual modifications, such as disp_subj.
*/
char *mutt_replacelist_apply(struct ReplaceList *rl, char *buf, size_t buflen, const char *str)
{
static regmatch_t *pmatch = NULL;
static size_t nmatch = 0;
- static char twinbuf[2][LONG_STRING];
+ static char twinbuf[2][1024];
int switcher = 0;
char *p = NULL;
size_t cpysize, tlen;
src = twinbuf[switcher];
dst = src;
- mutt_str_strfcpy(src, str, LONG_STRING);
+ mutt_str_strfcpy(src, str, 1024);
struct ReplaceListNode *np = NULL;
STAILQ_FOREACH(np, rl, entries)
/* Copy into other twinbuf with substitutions */
if (np->template)
{
- for (p = np->template; *p && (tlen < LONG_STRING - 1);)
+ for (p = np->template; *p && (tlen < 1023);)
{
if (*p == '%')
{
if (*p == 'L')
{
p++;
- cpysize = MIN(pmatch[0].rm_so, LONG_STRING - tlen - 1);
+ cpysize = MIN(pmatch[0].rm_so, 1023 - tlen);
strncpy(&dst[tlen], src, cpysize);
tlen += cpysize;
}
else if (*p == 'R')
{
p++;
- cpysize = MIN(strlen(src) - pmatch[0].rm_eo, LONG_STRING - tlen - 1);
+ cpysize = MIN(strlen(src) - pmatch[0].rm_eo, 1023 - tlen);
strncpy(&dst[tlen], &src[pmatch[0].rm_eo], cpysize);
tlen += cpysize;
}
while (isdigit((unsigned char) *p)) /* skip subst token */
p++;
for (int i = pmatch[n].rm_so;
- (i < pmatch[n].rm_eo) && (tlen < LONG_STRING - 1); i++)
+ (i < pmatch[n].rm_eo) && (tlen < 1023); i++)
{
dst[tlen++] = src[i];
}
#include <stdbool.h>
#include <stdio.h>
-#define LONG_STRING 1024
#define HUGE_STRING 8192
#define NONULL(x) (x ? x : "")
if (!m || !el)
return 0;
- char buf[LONG_STRING] = { 0 };
+ char buf[1024] = { 0 };
char *new = NULL;
struct EmailNode *en = STAILQ_FIRST(el);
char *fcc, size_t fcclen)
{
char path[PATH_MAX]; /* tempfile used to edit headers + body */
- char buffer[LONG_STRING];
+ char buffer[1024];
const char *p = NULL;
int i;
struct Envelope *n = NULL;
static void history_menu(char *buf, size_t buflen, char **matches, int match_count)
{
int done = 0;
- char helpstr[LONG_STRING];
+ char helpstr[1024];
char title[256];
snprintf(title, sizeof(title), _("History '%s'"), buf);
if (level > C_DebugLevel)
return 0;
- char buf[LONG_STRING];
+ char buf[1024];
va_list ap;
va_start(ap, level);
{
mutt_debug(LL_DEBUG2, " * lua_mutt_call()\n");
struct Buffer token, expn, err;
- char buffer[LONG_STRING] = "";
+ char buffer[1024] = "";
const struct Command *command = NULL;
int rc = 0;
static void lua_expose_command(void *p, const struct Command *cmd)
{
lua_State *l = (lua_State *) p;
- char buf[LONG_STRING];
+ char buf[1024];
snprintf(buf, sizeof(buf), "mutt.command.%s = function (...); mutt.call('%s', ...); end",
cmd->name, cmd->name);
(void) luaL_dostring(l, buf);
const struct ConnAccount *account)
{
struct Url url;
- char hook[LONG_STRING];
+ char hook[1024];
/* account isn't actually modified, since url isn't either */
mutt_account_tourl((struct ConnAccount *) account, &url);
*/
static int vw_printw(SLcurses_Window_Type *win, const char *fmt, va_list ap)
{
- char buf[LONG_STRING];
+ char buf[1024];
(void) SLvsnprintf(buf, sizeof(buf), (char *) fmt, ap);
SLcurses_waddnstr(win, buf, -1);
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src,
format_t *callback, unsigned long data, int flags)
{
- char prefix[128], tmp[LONG_STRING], *cp = NULL, *wptr = buf, ch;
+ char prefix[128], tmp[1024], *cp = NULL, *wptr = buf, ch;
char if_str[128], else_str[128];
size_t wlen, count, len, wid;
FILE *filter = NULL;
/* n-off is the number of backslashes. */
if (off > 0 && ((n - off) % 2) == 0)
{
- char srccopy[LONG_STRING];
+ char srccopy[1024];
int i = 0;
mutt_debug(LL_DEBUG3, "fmtpipe = %s\n", src);
; /* No state information so no way to print anything. */
else if (err)
{
- char buf[LONG_STRING];
+ char buf[1024];
snprintf(buf, sizeof(buf), _("Error getting key information for KeyID %s: %s\n"),
fpr, gpgme_strerror(err));
state_puts(buf, s);
*/
static void verify_key(struct CryptKeyInfo *key)
{
- char cmd[LONG_STRING], tempfile[PATH_MAX];
+ char cmd[1024], tempfile[PATH_MAX];
const char *s = NULL;
gpgme_ctx_t listctx = NULL;
gpgme_error_t err;
int keymax;
int i;
bool done = false;
- char helpstr[LONG_STRING], buf[LONG_STRING];
+ char helpstr[1024], buf[1024];
struct CryptKeyInfo *k = NULL;
int (*f)(const void *, const void *);
enum MenuType menu_to_use = MENU_GENERIC;
!crypt_id_is_strong(key_table[menu->current])))
{
const char *warn_s = NULL;
- char buf2[LONG_STRING];
+ char buf2[1024];
if (key_table[menu->current]->flags & KEYFLAG_CANTUSE)
{
struct Address *p = NULL, *q = NULL;
struct CryptKeyInfo *k_info = NULL;
const char *fqdn = mutt_fqdn(true);
- char buf[LONG_STRING];
+ char buf[1024];
int forced_valid;
int r;
bool key_selected;
gpgme_data_t keydata = NULL;
gpgme_error_t err;
struct Body *att = NULL;
- char buf[LONG_STRING];
+ char buf[1024];
struct stat sb;
OptPgpCheckTrust = false;
{
FILE *fp = NULL;
pid_t thepid;
- char buf[LONG_STRING];
+ char buf[1024];
struct PgpKeyInfo *db = NULL, **kend = NULL, *k = NULL, *kk = NULL, *mainkey = NULL;
int is_sub;
int devnull;
long C_PgpTimeout; ///< Config: Time in seconds to cache a passphrase
bool C_PgpUseGpgAgent; ///< Config: Use a PGP agent for caching passwords
-char PgpPass[LONG_STRING];
+char PgpPass[1024];
time_t PgpExptime = 0; /* when does the cached passphrase expire? */
/**
if (!a || !s || !fpout || !p)
return NULL;
- char buf[LONG_STRING];
+ char buf[1024];
FILE *pgpin = NULL, *pgpout = NULL, *pgptmp = NULL;
struct stat info;
struct Body *tattach = NULL;
struct Body *pgp_class_sign_message(struct Body *a)
{
struct Body *t = NULL;
- char buffer[LONG_STRING];
+ char buffer[1024];
char sigfile[PATH_MAX], signedfile[PATH_MAX];
FILE *pgpin = NULL, *pgpout = NULL, *pgperr = NULL, *sfp = NULL;
bool err = false;
struct Address *addr = NULL;
struct Address *p = NULL, *q = NULL;
struct PgpKeyInfo *k_info = NULL;
- char buf[LONG_STRING];
+ char buf[1024];
int r;
bool key_selected;
*/
struct Body *pgp_class_encrypt_message(struct Body *a, char *keylist, bool sign)
{
- char buf[LONG_STRING];
+ char buf[1024];
char tempfile[PATH_MAX];
char pgpinfile[PATH_MAX];
FILE *pgpin = NULL, *fptmp = NULL;
const char *prompt = NULL;
const char *letters = NULL;
const char *choices = NULL;
- char promptbuf[LONG_STRING];
+ char promptbuf[1024];
int choice;
if (!(WithCrypto & APPLICATION_PGP))
void pgp_class_invoke_getkeys(struct Address *addr)
{
char buf[PATH_MAX];
- char tmp[LONG_STRING];
+ char tmp[1024];
char cmd[HUGE_STRING];
int devnull;
struct Menu *menu = NULL;
int i;
bool done = false;
- char helpstr[LONG_STRING], buf[LONG_STRING], tmpbuf[256];
- char cmd[LONG_STRING], tempfile[PATH_MAX];
+ char helpstr[1024], buf[1024], tmpbuf[256];
+ char cmd[1024], tempfile[PATH_MAX];
FILE *fp = NULL, *devnull = NULL;
pid_t thepid;
struct PgpKeyInfo *kp = NULL;
!pgp_id_is_strong(KeyTable[menu->current])))
{
const char *str = "";
- char buf2[LONG_STRING];
+ char buf2[1024];
if (KeyTable[menu->current]->flags & KEYFLAG_CANTUSE)
{
struct Body *pgp_class_make_key_attachment(void)
{
struct Body *att = NULL;
- char buf[LONG_STRING];
+ char buf[1024];
char tempf[PATH_MAX], tmp[256];
FILE *tempfp = NULL;
FILE *devnull = NULL;
if (!optional)
{
char path[PATH_MAX];
- char buf1[LONG_STRING], buf2[LONG_STRING];
+ char buf1[1024], buf2[1024];
struct stat sb;
mutt_str_strfcpy(path, C_SmimeCaLocation, sizeof(path));
int table_index = 0;
struct SmimeKey *key = NULL;
struct SmimeKey *selected_key = NULL;
- char helpstr[LONG_STRING];
- char buf[LONG_STRING];
+ char helpstr[1024];
+ char buf[1024];
char title[256];
struct Menu *menu = NULL;
const char *s = "";
static struct SmimeKey *smime_get_candidates(char *search, bool public)
{
char index_file[PATH_MAX];
- char buf[LONG_STRING];
+ char buf[1024];
struct SmimeKey *key = NULL, *results = NULL;
struct SmimeKey **results_end = &results;
key = smime_get_key_by_addr(q->mailbox, KEYFLAG_CANENCRYPT, true, !oppenc_mode);
if (!key && !oppenc_mode)
{
- char buf[LONG_STRING];
+ char buf[1024];
snprintf(buf, sizeof(buf), _("Enter keyID for %s: "), q->mailbox);
key = smime_ask_for_key(buf, KEYFLAG_CANENCRYPT, true);
}
*/
struct Body *smime_class_build_smime_entity(struct Body *a, char *certlist)
{
- char buf[LONG_STRING], certfile[PATH_MAX];
+ char buf[1024], certfile[PATH_MAX];
char tempfile[PATH_MAX];
char smimeinfile[PATH_MAX];
char *cert_end = NULL;
*/
struct Body *smime_class_sign_message(struct Body *a)
{
- char buffer[LONG_STRING];
+ char buffer[1024];
char signedfile[PATH_MAX], filetosign[PATH_MAX];
FILE *smimein = NULL, *smimeout = NULL, *smimeerr = NULL, *sfp = NULL;
int err = 0;
if (!adata)
return -1;
- buflen = 10 * LONG_STRING;
+ buflen = 10240;
buf = mutt_mem_calloc(1, buflen);
off = 0;
/* write entries */
for (unsigned int j = 0; j < mdata->newsrc_len; j++)
{
- if (off + LONG_STRING > buflen)
+ if (off + 1024 > buflen)
{
buflen *= 2;
mutt_mem_realloc(&buf, buflen);
{
struct NntpAccountData *adata = data;
struct NntpMboxData *mdata = NULL;
- char group[LONG_STRING] = "";
+ char group[1024] = "";
char desc[HUGE_STRING] = "";
char mod;
anum_t first, last;
if (!adata->cacheable)
return 0;
- buflen = 10 * LONG_STRING;
+ buflen = 10240;
buf = mutt_mem_calloc(1, buflen);
snprintf(buf, buflen, "%lu\n", (unsigned long) adata->newgroups_time);
off = strlen(buf);
{
struct Connection *conn = adata->conn;
bool mode_reader = false;
- char buf[LONG_STRING];
- char authinfo[LONG_STRING] = "";
+ char buf[1024];
+ char authinfo[1024] = "";
adata->hasCAPABILITIES = false;
adata->hasSTARTTLS = false;
static int nntp_attempt_features(struct NntpAccountData *adata)
{
struct Connection *conn = adata->conn;
- char buf[LONG_STRING];
+ char buf[1024];
/* no CAPABILITIES, trying DATE, LISTGROUP, LIST NEWSGROUPS */
if (!adata->hasCAPABILITIES)
else
{
int cont = 0;
- size_t buflen = 2 * LONG_STRING, off = 0, b = 0;
+ size_t buflen = 2048, off = 0, b = 0;
FREE(&adata->overview_fmt);
adata->overview_fmt = mutt_mem_malloc(buflen);
while (true)
{
- if (buflen - off < LONG_STRING)
+ if (buflen - off < 1024)
{
buflen *= 2;
mutt_mem_realloc(&adata->overview_fmt, buflen);
*/
static void nntp_log_binbuf(const char *buf, size_t len, const char *pfx, int dbg)
{
- char tmp[LONG_STRING];
+ char tmp[1024];
char *p = tmp;
char *sentinel = tmp + len;
static int nntp_auth(struct NntpAccountData *adata)
{
struct Connection *conn = adata->conn;
- char buf[LONG_STRING];
- char authenticators[LONG_STRING] = "USER";
+ char buf[1024];
+ char authenticators[1024] = "USER";
char *method = NULL, *a = NULL, *p = NULL;
unsigned char flags = conn->account.flags;
sasl_conn_t *saslconn = NULL;
sasl_interact_t *interaction = NULL;
int rc;
- char inbuf[LONG_STRING] = "";
+ char inbuf[1024] = "";
const char *mech = NULL;
const char *client_out = NULL;
unsigned int client_len, len;
static int nntp_query(struct NntpMboxData *mdata, char *line, size_t linelen)
{
struct NntpAccountData *adata = mdata->adata;
- char buf[LONG_STRING] = { 0 };
+ char buf[1024] = { 0 };
if (adata->status == NNTP_BYE)
return -1;
while (!done)
{
- char buf[LONG_STRING];
+ char buf[1024];
char *line = NULL;
unsigned int lines = 0;
size_t off = 0;
*/
static int nntp_group_poll(struct NntpMboxData *mdata, bool update_stat)
{
- char buf[LONG_STRING] = "";
+ char buf[1024] = "";
anum_t count, first, last;
/* use GROUP command to poll newsgroup */
if (adata->hasDATE)
{
struct NntpMboxData mdata;
- char buf[LONG_STRING];
+ char buf[1024];
struct tm tm;
memset(&tm, 0, sizeof(tm));
{
struct NntpMboxData *mdata = NULL;
struct NntpMboxData tmp_mdata = { 0 };
- char buf[LONG_STRING];
+ char buf[1024];
if (m && (m->magic == MUTT_NNTP))
mdata = m->mdata;
{
struct NntpMboxData tmp_mdata;
char msg[256];
- char buf[LONG_STRING];
+ char buf[1024];
unsigned int i;
int rc;
struct NntpMboxData tmp_mdata;
time_t now;
struct tm *tm = NULL;
- char buf[LONG_STRING];
+ char buf[1024];
char *msg = _("Checking for new newsgroups...");
unsigned int i;
int rc, update_active = false;
struct Mailbox *m = ctx->mailbox;
struct NntpMboxData *mdata = m->mdata;
- char buf[LONG_STRING];
+ char buf[1024];
FILE *fp = mutt_file_mkstemp();
if (!fp)
return -1;
char buf[HUGE_STRING];
- char server[LONG_STRING];
+ char server[1024];
char *group = NULL;
int rc;
void *hc = NULL;
struct NmMboxData *nm_get_default_data(void)
{
// path to DB + query + URI "decoration"
- char uri[PATH_MAX + LONG_STRING + 32];
+ char uri[PATH_MAX + 1024 + 32];
// Try to use C_NmDefaultUri or C_Folder.
// If neither are set, it is impossible to create a Notmuch URI.
if (window)
{
- char buf[LONG_STRING];
+ char buf[1024];
mutt_str_replace(&C_NmQueryWindowCurrentSearch, mdata->db_query);
/* if a date part is defined, do not apply windows (to avoid the risk of
{
mutt_debug(LL_DEBUG2, "(%s)\n", buf);
struct NmMboxData *mdata = nm_mdata_get(m);
- char uri[PATH_MAX + LONG_STRING + 32]; /* path to DB + query + URI "decoration" */
+ char uri[PATH_MAX + 1024 + 32]; /* path to DB + query + URI "decoration" */
int added;
bool using_default_data = false;
static void pager_custom_redraw(struct Menu *pager_menu)
{
struct PagerRedrawData *rd = pager_menu->redraw_data;
- char buffer[LONG_STRING];
+ char buffer[1024];
if (!rd)
return;
int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *extra)
{
static char searchbuf[256] = "";
- char buffer[LONG_STRING];
+ char buffer[1024];
char helpstr[256];
char tmphelp[256];
int ch = 0, rc = -1;
beep();
if (C_NewMailCommand)
{
- char cmd[LONG_STRING];
+ char cmd[1024];
menu_status_line(cmd, sizeof(cmd), rd.index, NONULL(C_NewMailCommand));
if (mutt_system(cmd) != 0)
mutt_error(_("Error running \"%s\""), cmd);
static struct Pattern *SearchPattern = NULL; /**< current search pattern */
static char LastSearch[256] = { 0 }; /**< last pattern searched for */
-static char LastSearchExpn[LONG_STRING] = { 0 }; /**< expanded version of LastSearch */
+static char LastSearchExpn[1024] = { 0 }; /**< expanded version of LastSearch */
/**
* eat_regex - Parse a regex
mutt_str_strfcpy(s, "~U", len);
else
{
- char tmp[LONG_STRING];
+ char tmp[1024];
quote_simple(s, tmp, sizeof(tmp));
mutt_file_expand_fmt(s, len, simple, tmp);
}
int mutt_pattern_func(int op, char *prompt)
{
struct Pattern *pat = NULL;
- char buf[LONG_STRING] = "", *simple = NULL;
+ char buf[1024] = "", *simple = NULL;
struct Buffer err;
int rc = -1, padding;
struct Progress progress;
/* compare the *expanded* version of the search pattern in case
$simple_search has changed while we were searching */
- char temp[LONG_STRING];
+ char temp[1024];
mutt_str_strfcpy(temp, buf, sizeof(temp));
mutt_check_simple(temp, sizeof(temp), NONULL(C_SimpleSearch));
int index = 0;
size_t length = 0;
- char buf[LONG_STRING];
+ char buf[1024];
snprintf(buf, sizeof(buf), "LIST %d\r\n", e->refno);
int rc = pop_query(adata, buf, sizeof(buf));
return mutt_hcache_open(C_HeaderCache, path, NULL);
struct Url url;
- char p[LONG_STRING];
+ char p[1024];
mutt_account_tourl(&adata->conn->account, &url);
url.path = HC_FNAME;
return;
}
- char buffer[LONG_STRING];
+ char buffer[1024];
char msgbuf[128];
int delanswer, last = 0, msgs, bytes, rset = 0, ret;
struct ConnAccount acct;
return -1;
int i, j, ret = 0;
- char buf[LONG_STRING];
+ char buf[1024];
struct PopAccountData *adata = pop_adata_get(m);
struct Progress progress;
#ifdef USE_HCACHE
if (!m)
return -1;
- char buf[LONG_STRING];
+ char buf[1024];
char path[PATH_MAX];
struct Progress progressbar;
struct PopAccountData *adata = pop_adata_get(m);
sasl_conn_t *saslconn = NULL;
sasl_interact_t *interaction = NULL;
int rc;
- char inbuf[LONG_STRING];
+ char inbuf[1024];
const char *mech = NULL;
const char *pc = NULL;
unsigned int len = 0, olen = 0, client_start;
mutt_message(_("Authenticating (SASL)..."));
- size_t bufsize = ((olen * 2) > LONG_STRING) ? (olen * 2) : LONG_STRING;
+ size_t bufsize = MAX((olen * 2), 1024);
char *buf = mutt_mem_malloc(bufsize);
snprintf(buf, bufsize, "AUTH %s", mech);
struct Md5Ctx mctx;
unsigned char digest[16];
char hash[33];
- char buf[LONG_STRING];
+ char buf[1024];
if (mutt_account_getpass(&adata->conn->account) || !adata->conn->account.pass[0])
return POP_A_FAILURE;
mutt_message(_("Logging in..."));
- char buf[LONG_STRING];
+ char buf[1024];
snprintf(buf, sizeof(buf), "USER %s\r\n", adata->conn->account.user);
int ret = pop_query(adata, buf, sizeof(buf));
mutt_socket_send(adata->conn, "\001");
char *err = adata->err_msg;
- char decoded_err[LONG_STRING];
+ char decoded_err[1024];
int len = mutt_b64_decode(adata->err_msg, decoded_err, sizeof(decoded_err) - 1);
if (len >= 0)
{
*/
static int pop_capabilities(struct PopAccountData *adata, int mode)
{
- char buf[LONG_STRING];
+ char buf[1024];
/* don't check capabilities on reconnect */
if (adata->capabilities)
*/
int pop_connect(struct PopAccountData *adata)
{
- char buf[LONG_STRING];
+ char buf[1024];
adata->status = POP_NONE;
if (mutt_socket_open(adata->conn) < 0 ||
*/
int pop_open_connection(struct PopAccountData *adata)
{
- char buf[LONG_STRING];
+ char buf[1024];
int rc = pop_connect(adata);
if (rc < 0)
if (adata->status == POP_CONNECTED)
{
int ret = 0;
- char buf[LONG_STRING];
+ char buf[1024];
mutt_message(_("Closing connection to POP server..."));
if (m->readonly)
int pop_fetch_data(struct PopAccountData *adata, const char *query,
struct Progress *progressbar, int (*func)(char *, void *), void *data)
{
- char buf[LONG_STRING];
+ char buf[1024];
long pos = 0;
size_t lenbuf = 0;
{
int r = -1;
bool done = false;
- char helpstr[LONG_STRING];
+ char helpstr[1024];
struct Menu *menu = mutt_menu_new(MENU_POST);
menu->menu_make_entry = post_make_entry;
*/
int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app)
{
- char smime_cryptalg[LONG_STRING] = "\0";
- char sign_as[LONG_STRING] = "\0", *q = NULL;
+ char smime_cryptalg[1024] = "\0";
+ char sign_as[1024] = "\0", *q = NULL;
int flags = 0;
if (!WithCrypto)
menu->menu_search = query_search;
menu->menu_tag = query_tag;
menu->title = title;
- char helpstr[LONG_STRING];
+ char helpstr[1024];
menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_QUERY, QueryHelp);
mutt_menu_push_current(menu);
*/
void mutt_view_attachments(struct Email *e)
{
- char helpstr[LONG_STRING];
+ char helpstr[1024];
struct Body *cur = NULL;
int flags = 0;
int op = OP_NULL;
struct Coord *coords = NULL;
struct Menu *menu = NULL;
- char helpstr[LONG_STRING];
+ char helpstr[1024];
bool loop = true;
char *t = NULL;
int x = 0, y = 0;
int needspipe = true;
char buf[HUGE_STRING];
- char type2[LONG_STRING];
+ char type2[1024];
mutt_str_strfcpy(type2, type, sizeof(type2));
size_t len = 0;
unsigned char c = '\0';
FILE *in = NULL, *out = NULL;
- char buf[LONG_STRING];
+ char buf[1024];
char tmpfile[PATH_MAX];
if (!e || !e->content || !e->content->filename)
if (!C_ForwardAttributionIntro || !fp)
return;
- char buf[LONG_STRING];
+ char buf[1024];
setlocale(LC_TIME, NONULL(C_AttributionLocale));
mutt_make_string(buf, sizeof(buf), C_ForwardAttributionIntro, NULL, m, e);
setlocale(LC_TIME, "");
if (!C_ForwardAttributionTrailer || !fp)
return;
- char buf[LONG_STRING];
+ char buf[1024];
setlocale(LC_TIME, NONULL(C_AttributionLocale));
mutt_make_string(buf, sizeof(buf), C_ForwardAttributionTrailer, NULL, m, e);
setlocale(LC_TIME, "");
if (!C_Attribution || !out)
return;
- char buf[LONG_STRING];
+ char buf[1024];
setlocale(LC_TIME, NONULL(C_AttributionLocale));
mutt_make_string(buf, sizeof(buf), C_Attribution, NULL, m, e);
setlocale(LC_TIME, "");
if (!attf)
return false;
- char *inputline = mutt_mem_malloc(LONG_STRING);
+ char *inputline = mutt_mem_malloc(1024);
bool found = false;
while (!feof(attf))
{
- fgets(inputline, LONG_STRING, attf);
+ fgets(inputline, 1024, attf);
if (!mutt_is_quote_line(inputline, NULL) &&
regexec(C_AbortNoattachRegex->regex, inputline, 0, NULL, 0) == 0)
{
int ci_send_message(int flags, struct Email *msg, const char *tempfile,
struct Context *ctx, struct EmailList *el)
{
- char buf[LONG_STRING];
+ char buf[1024];
char fcc[PATH_MAX] = ""; /* where to copy this message */
FILE *tempfp = NULL;
struct Body *pbody = NULL;
*/
struct Body *mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg)
{
- char buf[LONG_STRING];
+ char buf[1024];
struct Body *body = NULL;
FILE *fp = NULL;
int cmflags, chflags;
void mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool display)
{
struct Address *tmp = NULL;
- char buf[LONG_STRING];
+ char buf[1024];
int count = 0;
while (addr)
struct Body *attach, enum MuttWriteHeaderMode mode,
bool privacy, bool hide_protected_subject)
{
- char buf[LONG_STRING];
+ char buf[1024];
char *p = NULL, *q = NULL;
bool has_agent = false; /* user defined user-agent header field exists */
#ifdef USE_NNTP
if (OptNewsSend)
{
- char cmd[LONG_STRING];
+ char cmd[1024];
mutt_expando_format(cmd, sizeof(cmd), 0, MuttIndexWindow->cols,
NONULL(C_Inews), nntp_format_str, 0, 0);
env->to->group = 1;
env->to->next = mutt_addr_new();
- char buf[LONG_STRING];
+ char buf[1024];
buf[0] = 0;
mutt_addr_cat(buf, sizeof(buf), "undisclosed-recipients", AddressSpecials);
if (tempfp)
{
- char sasha[LONG_STRING];
+ char sasha[1024];
int lines = 0;
mutt_write_mime_body(e->content, tempfp);
*/
static int smtp_helo(struct Connection *conn, bool esmtp)
{
- char buf[LONG_STRING];
+ char buf[1024];
const char *fqdn = NULL;
Capabilities = 0;
if (!OptNoCurses)
mutt_message(_("Authenticating (%s)..."), mech);
- bufsize = ((len * 2) > LONG_STRING) ? (len * 2) : LONG_STRING;
+ bufsize = MAX((len * 2), 1024);
buf = mutt_mem_malloc(bufsize);
snprintf(buf, bufsize, "AUTH %s", mech);
*/
static int smtp_auth_plain(struct Connection *conn)
{
- char buf[LONG_STRING];
+ char buf[1024];
/* Get username and password. Bail out of any cannot be retrieved. */
if ((mutt_account_getuser(&conn->account) < 0) ||