if (pw)
{
- char namebuf[STRING];
+ char namebuf[256];
mutt_gecos_name(namebuf, sizeof(namebuf), pw);
mutt_str_replace(&a->personal, namebuf);
*/
static int bcache_path(struct ConnAccount *account, const char *mailbox, char *dst, size_t dstlen)
{
- char host[STRING];
+ char host[256];
struct Url url = { U_UNKNOWN };
int len;
char buf[PATH_MAX];
char prefix[PATH_MAX] = "";
char helpstr[LONG_STRING];
- char title[STRING];
+ char title[256];
struct BrowserState state = { 0 };
struct Menu *menu = NULL;
bool kill_prefix = false;
if ((op == OP_SUBSCRIBE_PATTERN) || (op == OP_UNSUBSCRIBE_PATTERN))
{
- char tmp[STRING];
+ char tmp[256];
buf[0] = '\0';
if (op == OP_SUBSCRIBE_PATTERN)
#endif /* USE_NNTP */
#ifdef USE_IMAP
{
- char tmp[STRING];
+ char tmp[256];
mutt_str_strfcpy(tmp, state.entry[menu->current].name, sizeof(tmp));
mutt_expand_path(tmp, sizeof(tmp));
imap_subscribe(tmp, (op == OP_BROWSER_SUBSCRIBE));
if (mutt_get_field(":", buffer, sizeof(buffer), MUTT_COMMAND) != 0 || !buffer[0])
return;
- struct Buffer *err = mutt_buffer_alloc(STRING);
- struct Buffer *token = mutt_buffer_alloc(STRING);
+ struct Buffer *err = mutt_buffer_alloc(256);
+ struct Buffer *token = mutt_buffer_alloc(256);
/* check if buffer is a valid icommand, else fall back quietly to parse_rc_lines */
enum CommandResult rc = mutt_parse_icommand(buffer, err);
{
char buf[LONG_STRING];
char obuf[LONG_STRING];
- char tmp[STRING];
- char charset[STRING];
+ char tmp[256];
+ char charset[256];
short charset_changed = 0;
short type_changed = 0;
mutt_expand_path(buf, sizeof(buf));
/* Call to lookup_mime_type () ? maybe later */
- char type[STRING] = { 0 };
+ char type[256] = { 0 };
if (mutt_get_field("Content-Type: ", type, sizeof(type), 0) != 0 || !type[0])
continue;
char child[128];
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
for (size_t i = 0; i < (*ac)->num_vars; i++)
{
bool result = true;
- struct Buffer *value = mutt_buffer_alloc(STRING);
- struct Buffer *initial = mutt_buffer_alloc(STRING);
- struct Buffer *tmp = mutt_buffer_alloc(STRING);
+ struct Buffer *value = mutt_buffer_alloc(256);
+ struct Buffer *initial = mutt_buffer_alloc(256);
+ struct Buffer *tmp = mutt_buffer_alloc(256);
for (size_t i = 0; list[i]; i++)
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = calloc(1, err.dsize);
bool rc = true;
struct Buffer err;
mutt_buffer_init(&err);
- err.data = calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = calloc(1, err.dsize);
struct Inheritance *i = mutt_mem_calloc(1, sizeof(*i));
i->parent = parent;
int rc = -1;
#if defined(HAVE_GETADDRINFO) || defined(HAVE_GETADDRINFO_A)
- char node[STRING];
+ char node[256];
if (gethostname(node, sizeof(node)) != 0)
return rc;
X509 *cert = NULL;
X509_STORE *store = NULL;
int rc = 1;
- char buf[STRING];
+ char buf[256];
mutt_debug(LL_DEBUG2, "loading trusted certificates\n");
store = SSL_CTX_get_cert_store(ctx);
X509_NAME *x509_subject = NULL;
X509_NAME *x509_issuer = NULL;
char helpstr[LONG_STRING];
- char buf[STRING];
- char title[STRING];
+ char buf[256];
+ char title[256];
struct Menu *menu = mutt_menu_new(MENU_GENERIC);
int done, row;
FILE *fp = NULL;
*/
static int ssl_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
{
- char buf[STRING];
+ char buf[256];
const char *host = NULL;
size_t len;
int pos;
char datestr[30];
struct Menu *menu = NULL;
char helpstr[LONG_STRING];
- char title[STRING];
+ char title[256];
FILE *fp = NULL;
gnutls_datum_t pemdata;
int row, done, ret;
static int append_message(struct Mailbox *dest, FILE *fpin, struct Mailbox *src,
struct Email *e, int cmflags, int chflags)
{
- char buf[STRING];
+ char buf[256];
struct Message *msg = NULL;
int r;
static void format_address_header(char **h, struct Address *a)
{
char buf[HUGE_STRING];
- char cbuf[STRING];
- char c2buf[STRING];
+ char cbuf[256];
+ char c2buf[256];
char *p = NULL;
size_t linelen, buflen, plen;
rc = mutt_pager(banner, tempfile, do_color, info);
else
{
- char cmd[STRING];
+ char cmd[256];
mutt_endwin();
mutt_file_expand_fmt_quote(cmd, sizeof(cmd), C_Pager, tempfile);
static int ev_message(enum EvMessage action, struct Mailbox *m, struct Email *e)
{
char fname[PATH_MAX];
- char buf[STRING];
+ char buf[256];
int rc;
struct stat sb;
*/
const char *mutt_idna_print_version(void)
{
- static char vstring[STRING];
+ static char vstring[256];
#ifdef HAVE_IDN2_H
snprintf(vstring, sizeof(vstring), "libidn2: %s (compiled with %s)",
!mutt_regexlist_match(&UnSubscribedLists, lpenv->to->mailbox))
{
struct Buffer err;
- char errbuf[STRING];
+ char errbuf[256];
memset(&err, 0, sizeof(err));
err.data = errbuf;
err.dsize = sizeof(errbuf);
buf++;
offset = buf - line;
- if (*linelen < (offset + STRING))
+ if (*linelen < (offset + 256))
{
/* grow the buffer */
- *linelen += STRING;
+ *linelen += 256;
mutt_mem_realloc(&line, *linelen);
buf = line + offset;
}
*/
static void join_continuations(struct ParameterList *p, struct Rfc2231Parameter *par)
{
- char attribute[STRING];
- char charset[STRING];
+ char attribute[256];
+ char charset[256];
while (par)
{
struct Rfc2231Parameter *conttmp = NULL;
char *s = NULL, *t = NULL;
- char charset[STRING];
+ char charset[256];
bool encoded;
int index;
*/
enum UrlScheme url_check_scheme(const char *s)
{
- char sbuf[STRING];
+ char sbuf[256];
char *t = NULL;
int i;
if (u->user && (u->user[0] || !(flags & U_PATH)))
{
- char str[STRING];
+ char str[256];
url_pct_encode(str, sizeof(str), u->user);
snprintf(buf, buflen, "%s@", str);
l = strlen(buf);
if (stte->tag_level[RICH_COLOR])
{
if (stte->param_used + 1 >= stte->param_len)
- mutt_mem_realloc(&stte->param, (stte->param_len += STRING) * sizeof(wchar_t));
+ mutt_mem_realloc(&stte->param, (stte->param_len += 256) * sizeof(wchar_t));
stte->param[stte->param_used++] = c;
}
((MuttIndexWindow->cols - 4) < 72) ? (MuttIndexWindow->cols - 4) : 72);
stte.line_max = stte.wrap_margin * 4;
stte.line = mutt_mem_calloc(1, (stte.line_max + 1) * sizeof(wchar_t));
- stte.param = mutt_mem_calloc(1, (STRING) * sizeof(wchar_t));
+ stte.param = mutt_mem_calloc(1, 256 * sizeof(wchar_t));
- stte.param_len = STRING;
+ stte.param_len = 256;
stte.param_used = 0;
if (s->prefix)
WHERE struct Context *Context;
-WHERE bool ErrorBufMessage; ///< true if the last message was an error
-WHERE char ErrorBuf[STRING]; ///< Copy of the last error message
-WHERE char AttachmentMarker[STRING]; ///< Unique ANSI string to mark PGP messages in an email
-WHERE char ProtectedHeaderMarker[STRING]; ///< Unique ANSI string to mark protected headers in an email
+WHERE bool ErrorBufMessage; ///< true if the last message was an error
+WHERE char ErrorBuf[256]; ///< Copy of the last error message
+WHERE char AttachmentMarker[256]; ///< Unique ANSI string to mark PGP messages in an email
+WHERE char ProtectedHeaderMarker[256]; ///< Unique ANSI string to mark protected headers in an email
WHERE char *HomeDir; ///< User's home directory
WHERE char *ShortHostname; ///< Short version of the hostname
* size.
*
* Now, we don't special-case if the line we read with fgets() isn't
- * terminated. We don't care about this, since STRING > 78, so corrupted input
- * will just be corrupted a bit more. That implies that STRING+1 bytes are
+ * terminated. We don't care about this, since 256 > 78, so corrupted input
+ * will just be corrupted a bit more. That implies that 256+1 bytes are
* always sufficient to store the result of qp_decode_line.
*
* Finally, at soft line breaks, some part of a multibyte character may have
* been left over by convert_to_state(). This shouldn't be more than 6
- * characters, so STRING + 7 should be sufficient memory to store the decoded
+ * characters, so 256+7 should be sufficient memory to store the decoded
* data.
*
* Just to make sure that I didn't make some off-by-one error above, we just
- * use STRING*2 for the target buffer's size.
+ * use 512 for the target buffer's size.
*/
static void decode_quoted(struct State *s, long len, bool istext, iconv_t cd)
{
- char line[STRING];
- char decline[2 * STRING];
+ char line[256];
+ char decline[512];
size_t l = 0;
size_t l3;
{
struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
char buffer[LONG_STRING];
- char type[STRING];
+ char type[256];
char command[HUGE_STRING];
char tempfile[PATH_MAX] = "";
char *fname = NULL;
static int external_body_handler(struct Body *b, struct State *s)
{
const char *str = NULL;
- char strbuf[LONG_STRING]; // STRING might be too short but LONG_STRING should be large enough
+ char strbuf[LONG_STRING];
const char *access_type = mutt_param_get(&b->parameter, "access-type");
if (!access_type)
*/
const char *mutt_hcache_backend_list(void)
{
- char tmp[STRING] = { 0 };
+ char tmp[256] = { 0 };
const struct HcacheOps **ops = hcache_ops;
size_t len = 0;
{
if (len != 0)
{
- len += snprintf(tmp + len, STRING - len, ", ");
+ len += snprintf(tmp + len, sizeof(tmp) - len, ", ");
}
- len += snprintf(tmp + len, STRING - len, "%s", (*ops)->name);
+ len += snprintf(tmp + len, sizeof(tmp) - len, "%s", (*ops)->name);
}
return mutt_str_strdup(tmp);
current_hook_type = MUTT_FOLDER_HOOK;
mutt_buffer_init(&err);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
mutt_buffer_init(&token);
TAILQ_FOREACH(tmp, &Hooks, entries)
current_hook_type = type;
mutt_buffer_init(&err);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
mutt_buffer_init(&token);
TAILQ_FOREACH(hook, &Hooks, entries)
return;
mutt_buffer_init(&err);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
mutt_buffer_init(&token);
struct Hook *hook = NULL;
struct Buffer token;
struct Buffer err;
- char buf[STRING];
+ char buf[256];
mutt_buffer_init(&err);
err.data = buf;
struct Hook *hook = NULL;
struct Buffer token = { 0 };
struct Buffer err = { 0 };
- char buf[STRING];
+ char buf[256];
err.data = buf;
err.dsize = sizeof(buf);
*/
enum ImapAuthRes imap_auth_login(struct ImapAccountData *adata, const char *method)
{
- char q_user[STRING], q_pass[STRING];
+ char q_user[256], q_pass[256];
char buf[LONG_STRING];
if ((adata->capabilities & IMAP_CAP_LOGINDISABLED))
int rc = IMAP_CMD_CONTINUE;
enum ImapAuthRes res = IMAP_AUTH_SUCCESS;
static const char auth_plain_cmd[] = "AUTHENTICATE PLAIN";
- char buf[STRING] = { 0 };
+ char buf[256] = { 0 };
if (mutt_account_getuser(&adata->conn->account) < 0)
return IMAP_AUTH_FAILURE;
*/
static void cmd_parse_lsub(struct ImapAccountData *adata, char *s)
{
- char buf[STRING];
- char errstr[STRING];
+ char buf[256];
+ char errstr[256];
struct Buffer err, token;
struct Url url;
struct ImapList list;
}
else
{
- char term[STRING];
+ char term[256];
char *delim = NULL;
switch (pat->op)
struct ImapMboxData *mdata = NULL;
char buf[LONG_STRING * 2];
char mbox[LONG_STRING];
- char errstr[STRING];
+ char errstr[256];
struct Buffer err, token;
size_t len = 0;
mutt_message(_("No limit pattern is in effect"));
else
{
- char buf2[STRING];
+ char buf2[256];
/* L10N: ask for a limit to apply */
snprintf(buf2, sizeof(buf2), _("Limit: %s"), Context->pattern);
mutt_message("%s", buf2);
if (!Context->mailbox->quiet)
{
- char msgbuf[STRING];
+ char msgbuf[256];
snprintf(msgbuf, sizeof(msgbuf), _("Update tags..."));
mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, 1,
Context->mailbox->msg_tagged);
if (!mutt_get_field(_("Enter macro stroke: "), buf2, sizeof(buf2), MUTT_CLEAR) &&
buf2[0])
{
- char str[STRING], macro[STRING];
+ char str[256], macro[256];
snprintf(str, sizeof(str), "%s%s", C_MarkMacroPrefix, buf2);
snprintf(macro, sizeof(macro), "<search>~i \"%s\"\n", CUR_EMAIL->env->message_id);
/* L10N: "message hotkey" is the key bindings menu description of a
* the user has typed so far. Allocate LONG_STRING just to be sure! */
static char UserTyped[LONG_STRING] = { 0 };
-static int NumMatched = 0; /* Number of matches for completion */
-static char Completed[STRING] = { 0 }; /* completed string (command or variable) */
+static int NumMatched = 0; /* Number of matches for completion */
+static char Completed[256] = { 0 }; /* completed string (command or variable) */
static const char **Matches;
/* this is a lie until mutt_init runs: */
static int MatchesListsize = MAX(NUMVARS, NUMCOMMANDS) + 10;
struct Buffer err, token;
mutt_buffer_init(&err);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
mutt_buffer_init(&token);
struct ListNode *np = NULL;
for (int j = 0; names[j]; j++)
{
- char buffer[STRING];
+ char buffer[256];
snprintf(buffer, sizeof(buffer), "%s/%s%s", locations[i][0],
locations[i][1], names[j]);
*/
int mutt_dump_variables(bool hide_sensitive)
{
- char command[STRING];
+ char command[256];
struct Buffer err, token;
mutt_buffer_init(&err);
mutt_buffer_init(&token);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
for (int i = 0; MuttVars[i].name; i++)
struct Buffer err;
mutt_buffer_init(&err);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
err.dptr = err.data;
struct passwd *pw = getpwuid(getuid());
if (pw)
{
- char buf[STRING];
+ char buf[256];
C_Realname = mutt_str_strdup(mutt_gecos_name(buf, sizeof(buf), pw));
}
}
*/
int mutt_query_variables(struct ListHead *queries)
{
- struct Buffer *value = mutt_buffer_alloc(STRING);
- struct Buffer *tmp = mutt_buffer_alloc(STRING);
+ struct Buffer *value = mutt_buffer_alloc(256);
+ struct Buffer *tmp = mutt_buffer_alloc(256);
int rc = 0;
struct ListNode *np = NULL;
if (mutt_str_startswith(buf, "set", CASE_MATCH))
{
const char *myvarval = NULL;
- char var[STRING];
+ char var[256];
mutt_str_strfcpy(var, pt, sizeof(var));
/* ignore the trailing '=' when comparing */
int vlen = mutt_str_strlen(var);
myvarval = myvar_get(var);
if (myvarval)
{
- struct Buffer *pretty = mutt_buffer_alloc(STRING);
+ struct Buffer *pretty = mutt_buffer_alloc(256);
pretty_var(myvarval, pretty);
snprintf(pt, buflen - (pt - buf), "%s=%s", var, pretty->data);
mutt_buffer_free(&pretty);
}
else
{
- struct Buffer *value = mutt_buffer_alloc(STRING);
- struct Buffer *pretty = mutt_buffer_alloc(STRING);
+ struct Buffer *value = mutt_buffer_alloc(256);
+ struct Buffer *pretty = mutt_buffer_alloc(256);
int rc = cs_he_string_get(Config, he, value);
if (CSR_RESULT(rc) == CSR_SUCCESS)
{
bool mutt_mailbox_list(void)
{
char path[PATH_MAX];
- char mailboxlist[2 * STRING];
+ char mailboxlist[512];
size_t pos = 0;
int first = 1;
int flagged = 0;
int replied = 0;
- char seq_unseen[STRING];
- char seq_replied[STRING];
- char seq_flagged[STRING];
+ char seq_unseen[256];
+ char seq_replied[256];
+ char seq_flagged[256];
struct MhSequences mhs = { 0 };
char *tmpfname = NULL;
char sequences[PATH_MAX];
- char seq_unseen[STRING];
- char seq_replied[STRING];
- char seq_flagged[STRING];
+ char seq_unseen[256];
+ char seq_replied[256];
+ char seq_flagged[256];
char *buf = NULL;
int line = 0;
struct Maildir *md = NULL;
struct MhSequences mhs = { 0 };
struct Maildir **last = NULL;
- char msgbuf[STRING];
+ char msgbuf[256];
struct Progress progress;
if (!m->quiet)
"%s inv%s=42", "%s inv%s?", "%s &%s", "%s &%s=42", "%s &%s?",
};
- struct Buffer *tmp = mutt_buffer_alloc(STRING);
- struct Buffer *err = mutt_buffer_alloc(STRING);
+ struct Buffer *tmp = mutt_buffer_alloc(256);
+ struct Buffer *err = mutt_buffer_alloc(256);
char line[64];
for (size_t v = 0; v < mutt_array_size(vars); v++)
"record", "signature",
};
- struct Buffer *value = mutt_buffer_alloc(STRING);
+ struct Buffer *value = mutt_buffer_alloc(256);
for (size_t i = 0; i < mutt_array_size(names); i++)
{
struct HashElem *he = cs_get_elem(cs, names[i]);
#endif
if (!skip && (stat(fpath, &sb) == -1) && (errno == ENOENT))
{
- char msg2[STRING];
+ char msg2[256];
snprintf(msg2, sizeof(msg2), _("%s does not exist. Create it?"), C_Folder);
if (mutt_yesorno(msg2, MUTT_YES) == MUTT_YES)
{
if (!m->quiet)
{
- char msgbuf[STRING];
+ char msgbuf[256];
snprintf(msgbuf, sizeof(msgbuf), _("Reading %s..."), m->path);
mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_ReadInc, 0);
}
return -1;
struct stat sb;
- char buf[HUGE_STRING], return_path[STRING];
+ char buf[HUGE_STRING], return_path[256];
struct Email *e_cur = NULL;
time_t t;
int count = 0, lines = 0;
if (!m->quiet)
{
- char msgbuf[STRING];
+ char msgbuf[256];
snprintf(msgbuf, sizeof(msgbuf), _("Reading %s..."), m->path);
mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, C_ReadInc, 0);
}
}
enum MailboxType magic = MUTT_UNKNOWN;
- char tmp[STRING];
+ char tmp[256];
if (fgets(tmp, sizeof(tmp), fp))
{
if (mutt_str_startswith(tmp, "From ", CASE_MATCH))
*/
void menu_redraw_status(struct Menu *menu)
{
- char buf[STRING];
+ char buf[256];
snprintf(buf, sizeof(buf), MUTT_MODEFMT, menu->title);
SETCOLOR(MT_COLOR_STATUS);
if (!cs1 || !cs2)
return false;
- char buffer[STRING];
+ char buffer[256];
mutt_ch_canonical_charset(buffer, sizeof(buffer), cs1);
*/
void mutt_ch_set_charset(const char *charset)
{
- char buffer[STRING];
+ char buffer[256];
mutt_ch_canonical_charset(buffer, sizeof(buffer), charset);
if (!line)
{
- line = mutt_mem_malloc(STRING);
- *size = STRING;
+ *size = 256;
+ line = mutt_mem_malloc(*size);
}
while (true)
ungetc(c, fp); /* undo our damage */
/* There wasn't room for the line -- increase "line" */
offset = *size - 1; /* overwrite the terminating 0 */
- *size += STRING;
+ *size += 256;
mutt_mem_realloc(&line, *size);
}
}
#include <stdbool.h>
#include <stdio.h>
-#define STRING 256
#define LONG_STRING 1024
#define HUGE_STRING 8192
*/
int mutt_account_getuser(struct ConnAccount *account)
{
- char prompt[STRING];
+ char prompt[256];
/* already set */
if (account->flags & MUTT_ACCT_USER)
*/
int mutt_account_getpass(struct ConnAccount *account)
{
- char prompt[STRING];
+ char prompt[256];
if (account->flags & MUTT_ACCT_PASS)
return 0;
*/
int mutt_get_tmp_attachment(struct Body *a)
{
- char type[STRING];
+ char type[256];
char tempfile[PATH_MAX];
FILE *fpin = NULL, *fpout = NULL;
struct stat st;
*/
int mutt_compose_attachment(struct Body *a)
{
- char type[STRING];
+ char type[256];
char command[HUGE_STRING];
char newfile[PATH_MAX] = "";
struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
*/
int mutt_edit_attachment(struct Body *a)
{
- char type[STRING];
+ char type[256];
char command[HUGE_STRING];
char newfile[PATH_MAX] = "";
struct Rfc1524MailcapEntry *entry = rfc1524_new_entry();
bool use_mailcap = false;
bool use_pipe = false;
bool use_pager = true;
- char type[STRING];
+ char type[256];
char command[HUGE_STRING];
- char descrip[STRING];
+ char descrip[256];
char *fname = NULL;
struct Rfc1524MailcapEntry *entry = NULL;
int rc = -1;
int mutt_print_attachment(FILE *fp, struct Body *a)
{
char newfile[PATH_MAX] = "";
- char type[STRING];
+ char type[256];
pid_t thepid;
FILE *ifp = NULL, *fpout = NULL;
bool unlink_newfile = false;
{
int done = 0;
char helpstr[LONG_STRING];
- char title[STRING];
+ char title[256];
snprintf(title, sizeof(title), _("History '%s'"), buf);
mutt_buffer_init(&expn);
mutt_buffer_init(&err);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
err.data[0] = '\0';
struct ConfigDef *cdef = he->data;
int rc = 0;
- struct Buffer *err = mutt_buffer_alloc(STRING);
+ struct Buffer *err = mutt_buffer_alloc(256);
switch (DTYPE(cdef->type))
{
case DT_SORT:
case DT_STRING:
{
- struct Buffer *value = mutt_buffer_alloc(STRING);
+ struct Buffer *value = mutt_buffer_alloc(256);
int rc = cs_he_string_get(Config, he, value);
if (CSR_RESULT(rc) != CSR_SUCCESS)
{
return -1;
}
- struct Buffer *escaped = mutt_buffer_alloc(STRING);
+ struct Buffer *escaped = mutt_buffer_alloc(256);
escape_string(escaped, value->data);
lua_pushstring(l, escaped->data);
mutt_buffer_free(&value);
mutt_buffer_init(&err);
mutt_buffer_init(&token);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
if (mutt_parse_rc_line(buffer, &token, &err))
FILE *filter = NULL;
char *recycler = NULL;
- char src2[STRING];
+ char src2[256];
mutt_str_strfcpy(src2, src, mutt_str_strlen(src) + 1);
src = src2;
*/
const char *mutt_make_version(void)
{
- static char vstring[STRING];
+ static char vstring[256];
snprintf(vstring, sizeof(vstring), "NeoMutt %s%s", PACKAGE_VERSION, GitVer);
return vstring;
}
if (m->dontwrite)
{
- char buf[STRING], tmp[STRING];
+ char buf[256], tmp[256];
if (km_expand_key(buf, sizeof(buf), km_find_func(MENU_MAIN, OP_TOGGLE_WRITE)))
snprintf(tmp, sizeof(tmp), _(" Press '%s' to toggle write"), buf);
else
void crypt_current_time(struct State *s, const char *app_name)
{
time_t t;
- char p[STRING], tmp[STRING];
+ char p[256], tmp[256];
if (!WithCrypto)
return;
*/
static void print_time(time_t t, struct State *s)
{
- char p[STRING];
+ char p[256];
strftime(p, sizeof(p), nl_langinfo(D_T_FMT), localtime(&t));
state_puts(p, s);
gpgme_subkey_t subkey;
const char *shortid = NULL;
size_t len;
- char date[STRING];
+ char date[256];
int more;
int rc = -1;
time_t tt;
bool maybe_goodsig = true;
bool have_any_sigs = false;
- char body_charset[STRING]; /* Only used for clearsigned messages. */
+ char body_charset[256]; /* Only used for clearsigned messages. */
mutt_debug(LL_DEBUG2, "Entering handler\n");
bool have_any_sigs = false;
char *gpgcharset = NULL;
- char body_charset[STRING];
+ char body_charset[256];
mutt_body_get_charset(m, body_charset, sizeof(body_charset));
rc = 0;
char pgpoutfile[PATH_MAX];
char pgpinfile[PATH_MAX];
- char body_charset[STRING];
+ char body_charset[256];
char *from_charset = NULL;
const char *send_charset = NULL;
bool empty = false;
bool err;
- char buf[STRING];
+ char buf[256];
pid_t thepid;
struct Menu *menu = NULL;
int i;
bool done = false;
- char helpstr[LONG_STRING], buf[LONG_STRING], tmpbuf[STRING];
+ char helpstr[LONG_STRING], buf[LONG_STRING], tmpbuf[256];
char cmd[LONG_STRING], tempfile[PATH_MAX];
FILE *fp = NULL, *devnull = NULL;
pid_t thepid;
{
struct Body *att = NULL;
char buf[LONG_STRING];
- char tempf[PATH_MAX], tmp[STRING];
+ char tempf[PATH_MAX], tmp[256];
FILE *tempfp = NULL;
FILE *devnull = NULL;
struct stat sb;
const char *intermediates; /**< %i */
};
-char SmimePass[STRING];
+char SmimePass[256];
time_t SmimeExptime = 0; /* when does the cached passphrase expire? */
static char SmimeKeyToUse[PATH_MAX] = { 0 };
if (!key)
{
- char buf[STRING];
+ char buf[256];
snprintf(buf, sizeof(buf), _("Enter keyID for %s: "), mailbox);
key = smime_ask_for_key(buf, KEYFLAG_CANENCRYPT, false);
}
static int smime_handle_cert_email(char *certificate, char *mailbox, bool copy,
char ***buffer, int *num)
{
- char email[STRING];
+ char email[256];
int rc = -1, count = 0;
pid_t thepid;
size_t len = 0;
*/
void smime_class_invoke_import(char *infile, char *mailbox)
{
- char *certfile = NULL, buf[STRING];
+ char *certfile = NULL, buf[256];
FILE *smimein = NULL;
FILE *fperr = mutt_file_mkstemp();
*/
static int get_description(struct NntpMboxData *mdata, const char *wildmat, const char *msg)
{
- char buf[STRING];
+ char buf[256];
const char *cmd = NULL;
/* get newsgroup description, if possible */
int nntp_open_connection(struct NntpAccountData *adata)
{
struct Connection *conn = adata->conn;
- char buf[STRING];
+ char buf[256];
int cap;
bool posting = false, auth = true;
int nntp_active_fetch(struct NntpAccountData *adata, bool new)
{
struct NntpMboxData tmp_mdata;
- char msg[STRING];
+ char msg[256];
char buf[LONG_STRING];
unsigned int i;
int rc;
struct NntpMboxData *mdata = m->mdata;
struct ChildCtx cc;
- char buf[STRING];
+ char buf[256];
int rc;
bool quiet;
void *hc = NULL;
if (!mdata->progress_ready && q)
{
- static char msg[STRING];
+ static char msg[256];
snprintf(msg, sizeof(msg), _("Reading messages..."));
// The total mail count is in oldmsgcount, so use that instead of recounting.
}
else
{
- char bn[STRING];
+ char bn[256];
snprintf(bn, sizeof(bn), "%s (%s)", rd->banner, pager_progress_str);
mutt_draw_statusline(rd->pager_status_window->cols, bn, sizeof(bn));
}
*/
int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *extra)
{
- static char searchbuf[STRING] = "";
+ static char searchbuf[256] = "";
char buffer[LONG_STRING];
char helpstr[256];
char tmphelp[256];
// clang-format on
static struct Pattern *SearchPattern = NULL; /**< current search pattern */
-static char LastSearch[STRING] = { 0 }; /**< last pattern searched for */
+static char LastSearch[256] = { 0 }; /**< last pattern searched for */
static char LastSearchExpn[LONG_STRING] = { 0 }; /**< expanded version of LastSearch */
/**
static bool eat_regex(struct Pattern *pat, struct Buffer *s, struct Buffer *err)
{
struct Buffer buf;
- char errmsg[STRING];
+ char errmsg[256];
int r;
mutt_buffer_init(&buf);
}
}
- size_t blen = STRING;
+ size_t blen = 256;
char *buf = mutt_mem_malloc(blen);
/* search the file "fp" */
*/
static int match_content_type(const struct Pattern *pat, struct Body *b)
{
- char buffer[STRING];
+ char buffer[256];
if (!b)
return 0;
mutt_check_simple(buf, sizeof(buf), NONULL(C_SimpleSearch));
mutt_buffer_init(&err);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
pat = mutt_pattern_comp(buf, MUTT_FULL_MSG, &err);
if (!pat)
if (!*LastSearch || (op != OP_SEARCH_NEXT && op != OP_SEARCH_OPPOSITE))
{
- char buf[STRING];
+ char buf[256];
mutt_str_strfcpy(buf, *LastSearch ? LastSearch : "", sizeof(buf));
if (mutt_get_field((op == OP_SEARCH || op == OP_SEARCH_NEXT) ?
_("Search for: ") :
mutt_str_strfcpy(LastSearch, buf, sizeof(LastSearch));
mutt_message(_("Compiling search pattern..."));
mutt_pattern_free(&SearchPattern);
- err.dsize = STRING;
+ err.dsize = 256;
err.data = mutt_mem_malloc(err.dsize);
SearchPattern = mutt_pattern_comp(temp, MUTT_FULL_MSG, &err);
if (!SearchPattern)
static void message_bar(int percent, const char *fmt, ...)
{
va_list ap;
- char buf[STRING], buf2[STRING];
+ char buf[256], buf2[256];
int w = percent * COLS / 100;
size_t l;
char *buf = NULL;
size_t buflen;
int dummy = 0;
- char msg[STRING];
+ char msg[256];
char *p = NULL;
pid_t thepid;
struct Entry *entry = (struct Entry *) data;
struct Query *query = entry->data;
char fmt[128];
- char tmp[STRING] = "";
+ char tmp[256] = "";
int optional = (flags & MUTT_FORMAT_OPTIONAL);
switch (op)
struct Email *msg = NULL;
struct Entry *QueryTable = NULL;
struct Query *queryp = NULL;
- char title[STRING];
+ char title[256];
if (!results)
{
if (!buf)
{
- char buffer[STRING] = "";
+ char buffer[256] = "";
query_menu(buffer, sizeof(buffer), NULL, false);
}
*/
void mutt_update_tree(struct AttachCtx *actx)
{
- char buf[STRING];
+ char buf[256];
char *s = NULL;
mutt_update_v2r(actx);
if (filter)
{
- char warning[PATH_MAX + STRING];
+ char warning[PATH_MAX + 256];
snprintf(warning, sizeof(warning),
_("WARNING! You are about to overwrite %s, continue?"), body->filename);
if (mutt_yesorno(warning, MUTT_NO) != MUTT_YES)
*/
static bool can_print(struct AttachCtx *actx, struct Body *top, bool tag)
{
- char type[STRING];
+ char type[256];
for (int i = 0; !tag || (i < actx->idxlen); i++)
{
static void print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
struct Body *top, struct State *state)
{
- char type[STRING];
+ char type[256];
for (int i = 0; !tag || (i < actx->idxlen); i++)
{
if (!m || !fp || !actx)
return;
- char prompt[STRING];
+ char prompt[256];
char buf[HUGE_STRING];
char *err = NULL;
struct Address *addr = NULL;
struct Email *e_parent = NULL;
FILE *parent_fp = NULL;
char tmpbody[PATH_MAX];
- char prefix[STRING];
+ char prefix[256];
int rc = 0;
/* First, find the parent message.
*/
int mix_send_message(struct ListHead *chain, const char *tempfile)
{
- char cd_quoted[STRING];
+ char cd_quoted[256];
int i = 0;
struct Buffer *cmd = mutt_buffer_pool_get();
x++;
if (command[x] == '{')
{
- char param[STRING];
- char pvalue[STRING];
+ char param[256];
+ char pvalue[256];
char *pvalue2 = NULL;
int z = 0;
if (get_field_text(field + plen, &test_command, type, filename, line) && test_command)
{
- const size_t len = mutt_str_strlen(test_command) + STRING;
+ const size_t len = mutt_str_strlen(test_command) + 256;
mutt_mem_realloc(&test_command, len);
if (rfc1524_expand_command(a, a->filename, type, test_command, len) == 1)
{
*/
int safe_asprintf(char **strp, const char *fmt, ...)
{
- int rlen = STRING;
+ int rlen = 256;
*strp = mutt_mem_malloc(rlen);
while (true)
if (!C_PostIndentString || !out)
return;
- char buf[STRING];
+ char buf[256];
mutt_make_string(buf, sizeof(buf), C_PostIndentString, NULL, m, e);
fputs(buf, out);
fputc('\n', out);
*/
static int default_to(struct Address **to, struct Envelope *env, int flags, int hmfupto)
{
- char prompt[STRING];
+ char prompt[256];
if (flags && env->mail_followup_to && hmfupto == MUTT_YES)
{
if ((flags & (SEND_LIST_REPLY | SEND_GROUP_REPLY | SEND_GROUP_CHAT_REPLY)) && in->mail_followup_to)
{
- char prompt[STRING];
+ char prompt[256];
snprintf(prompt, sizeof(prompt), _("Follow-up to %s%s?"),
in->mail_followup_to->mailbox, in->mail_followup_to->next ? ",..." : "");
if (!env)
return;
- char buf[STRING];
+ char buf[256];
/* set the default subject for the message. */
mutt_make_string(buf, sizeof(buf), NONULL(C_ForwardFormat), NULL, m, cur);
fputc(';', f);
- char buf[STRING];
+ char buf[256];
buf[0] = 0;
tmp = mutt_str_strdup(np->value);
const int encode = rfc2231_encode_string(&tmp);
else
t = fn;
- char buf[STRING];
+ char buf[256];
buf[0] = 0;
tmp = mutt_str_strdup(t);
const int encode = rfc2231_encode_string(&tmp);
{
if (!chs)
{
- char chsbuf[STRING];
+ char chsbuf[256];
mutt_ch_canonical_charset(chsbuf, sizeof(chsbuf), tocode);
mutt_param_set(&b->parameter, "charset", chsbuf);
}
FILE *f = NULL;
char *p = NULL, *q = NULL, *ct = NULL;
char buf[PATH_MAX];
- char subtype[STRING], xtype[STRING];
+ char subtype[256], xtype[256];
int szf, sze, cur_sze;
int type;
bool found_mimetypes = false;
void mutt_update_encoding(struct Body *a)
{
struct Content *info = NULL;
- char chsbuf[STRING];
+ char chsbuf[256];
/* override noconv when it's us-ascii */
if (mutt_ch_is_us_ascii(mutt_body_get_charset(a, chsbuf, sizeof(chsbuf))))
return -1;
const char *fqdn = mutt_fqdn(true);
- char resent_from[STRING];
+ char resent_from[256];
char *err = NULL;
resent_from[0] = '\0';
*/
struct SbEntry
{
- char box[STRING]; /**< formatted mailbox name */
+ char box[256]; /**< formatted mailbox name */
struct Mailbox *mailbox; /**< Mailbox this represents */
bool is_hidden; /**< Don't show, e.g. $sidebar_new_mail_only */
};
{
struct SbEntry *sbe = (struct SbEntry *) data;
unsigned int optional;
- char fmt[STRING];
+ char fmt[256];
if (!sbe || !buf)
return src;
mutt_str_strcat(sidebar_folder_name, sfn_len, tmp_folder_name);
}
}
- char str[STRING];
+ char str[256];
make_sidebar_entry(str, sizeof(str), w, sidebar_folder_name, entry);
printw("%s", str);
if (sidebar_folder_depth > 0)
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
mutt_buffer_reset(&value);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
mutt_buffer_reset(&value);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
{
struct Buffer result;
mutt_buffer_init(&result);
- result.data = mutt_mem_calloc(1, STRING);
- result.dsize = STRING;
+ result.dsize = 256;
+ result.data = mutt_mem_calloc(1, result.dsize);
const char *events[] = { "set", "reset", "initial-set" };
struct Buffer result;
mutt_buffer_init(&result);
- result.data = mutt_mem_calloc(1, STRING);
- result.dsize = STRING;
+ result.dsize = 256;
+ result.data = mutt_mem_calloc(1, result.dsize);
char tmp[128];
char *list[26] = { 0 };
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
mutt_buffer_reset(&value);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
mutt_buffer_reset(&value);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
mutt_buffer_reset(&value);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
mutt_buffer_reset(&value);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
mutt_buffer_reset(&value);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer value;
mutt_buffer_init(&value);
- value.data = mutt_mem_calloc(1, STRING);
- value.dsize = STRING;
+ value.dsize = 256;
+ value.data = mutt_mem_calloc(1, value.dsize);
mutt_buffer_reset(&value);
int rc;
{
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);
struct Buffer err;
mutt_buffer_init(&err);
- err.data = mutt_mem_calloc(1, STRING);
- err.dsize = STRING;
+ err.dsize = 256;
+ err.data = mutt_mem_calloc(1, err.dsize);
mutt_buffer_reset(&err);
struct ConfigSet *cs = cs_new(30);