if (t)
{
i = false;
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, expn, entries)
{
if (mutt_str_strcmp(a->mailbox, np->data) == 0) /* alias already found */
if (*o == -1)
{
mutt_buffer_printf(err, _("%s: no such object"), buf->data);
- return (-1);
+ return -1;
}
}
else if ((*o = mutt_map_get_value(buf->data, Fields)) == -1)
if (!TAILQ_EMPTY(&b->parameter))
{
size_t l = strlen(buf);
- struct Parameter *np;
+ struct Parameter *np = NULL;
TAILQ_FOREACH(np, &b->parameter, entries)
{
mutt_addr_cat(tmp, sizeof(tmp), np->value, MimeSpecials);
}
int c = 12;
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, chain, entries)
{
t = np->data;
*/
static int ssl_setup(struct Connection *conn)
{
- struct SslSockData *ssldata;
+ struct SslSockData *ssldata = NULL;
int maxbits;
ssldata = mutt_mem_calloc(1, sizeof(struct SslSockData));
*/
if (flags & CH_REORDER)
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &HeaderOrderList, entries)
{
mutt_debug(3, "Reorder list: %s\n", np->data);
/* Find x -- the array entry where this header is to be saved */
if (flags & CH_REORDER)
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
x = 0;
STAILQ_FOREACH(np, &HeaderOrderList, entries)
{
if ((flags & CH_UPDATE_IRT) && !STAILQ_EMPTY(&h->env->in_reply_to))
{
fputs("In-Reply-To:", out);
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &h->env->in_reply_to, entries)
{
fputc(' ', out);
/* trying to find msgid of the root message */
if (op == OP_RECONSTRUCT_THREAD)
{
- struct ListNode *ref;
+ struct ListNode *ref = NULL;
STAILQ_FOREACH(ref, &CURHDR->env->references, entries)
{
if (mutt_hash_find(Context->id_hash, ref->data) == NULL)
if (!p)
return NULL;
- struct Parameter *np;
+ struct Parameter *np = NULL;
TAILQ_FOREACH(np, p, entries)
{
if (mutt_str_strcasecmp(s, np->attribute) == 0)
return;
}
- struct Parameter *np;
+ struct Parameter *np = NULL;
TAILQ_FOREACH(np, p, entries)
{
if (mutt_str_strcasecmp(attribute, np->attribute) == 0)
if (!p)
return;
- struct Parameter *np;
+ struct Parameter *np = NULL;
TAILQ_FOREACH(np, p, entries)
{
if (mutt_str_strcasecmp(attribute, np->attribute) == 0)
return NULL;
char *tags = NULL;
- struct TagNode *np;
+ struct TagNode *np = NULL;
STAILQ_FOREACH(np, head, entries)
{
if (filter && mutt_str_strcmp(np->name, filter) != 0)
if (tags)
{
- char *tag;
+ char *tag = NULL;
while ((tag = strsep(&tags, " ")))
driver_tags_add(head, tag);
FREE(&tags);
struct Header *h = cur->message;
/* clearing the References: header from obsolete Message-ID(s) */
- struct ListNode *np;
+ struct ListNode *np = NULL;
while ((np = STAILQ_NEXT(ref, entries)) != NULL)
{
STAILQ_REMOVE_AFTER(&cur->message->env->references, ref, entries);
{
/* determine if this type is on the user's auto_view list */
mutt_check_lookup_list(b, type, sizeof(type));
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &AutoViewList, entries)
{
int i = mutt_str_strlen(np->data) - 1;
a = b;
/* First, search list of preferred types */
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &AlternativeOrderList, entries)
{
int btlen; /* length of basetype */
d = dump_int(0xdeadbeef, d, off);
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, l, entries)
{
d = dump_char(np->data, d, off, convert);
restore_int(&counter, d, off);
- struct ListNode *np;
+ struct ListNode *np = NULL;
while (counter)
{
np = mutt_list_insert_tail(l, NULL);
d = dump_int(0xdeadbeef, d, off);
- struct Parameter *np;
+ struct Parameter *np = NULL;
TAILQ_FOREACH(np, p, entries)
{
d = dump_char(np->attribute, d, off, false);
restore_int(&counter, d, off);
- struct Parameter *np;
+ struct Parameter *np = NULL;
while (counter)
{
np = mutt_param_new();
*/
static void history_menu(char *buf, size_t buflen, char **matches, int match_count)
{
- struct Menu *menu;
+ struct Menu *menu = NULL;
int done = 0;
char helpstr[LONG_STRING];
char title[STRING];
if (STAILQ_EMPTY(flag_list))
return false;
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, flag_list, entries)
{
if (mutt_str_strncasecmp(np->data, flag, strlen(np->data)) == 0)
struct Buffer *cmd, int *err_continue)
{
char flags[LONG_STRING];
- char *tags;
+ char *tags = NULL;
char uid[11];
if (!compare_flags_for_copy(hdr))
void *uidnext = NULL;
#endif
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &idata->mboxcache, entries)
{
status = (struct ImapStatus *) np->data;
{
struct ImapStatus *status = NULL;
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &idata->mboxcache, entries)
{
status = (struct ImapStatus *) np->data;
mutt_debug(3, "No folder flags found\n");
else
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
struct Buffer flag_buffer;
mutt_buffer_init(&flag_buffer);
mutt_buffer_printf(&flag_buffer, "Mailbox flags: ");
{
int chunks = 0;
int state = 0; /* 1: single msn, 2: range of msn */
- unsigned int msn, range_begin, range_end;
+ unsigned int range_begin, range_end;
- for (msn = msn_begin; msn <= msn_end + 1; msn++)
+ for (unsigned int msn = msn_begin; msn <= msn_end + 1; msn++)
{
if (msn <= msn_end && !idata->msn_index[msn - 1])
{
return;
/* check to make sure the item is not already on this list */
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, head, entries)
{
if (mutt_str_strcasecmp(str, np->data) == 0)
err.dsize = STRING;
err.data = mutt_mem_malloc(err.dsize);
mutt_buffer_init(&token);
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, p, entries)
{
if (mutt_parse_rc_line(np->data, &token, &err) == -1)
*/
static int print_attach_list(struct ListHead *h, char op, char *name)
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, h, entries)
{
printf("attachments %c%s %s/%s\n", op, name,
}
else
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &Muttrc, entries)
{
mutt_str_strfcpy(buffer, np->data, sizeof(buffer));
}
/* Read the user's initialization file. */
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &Muttrc, entries)
{
if (np->data)
err.dsize = STRING;
err.data = mutt_mem_malloc(err.dsize);
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, queries, entries)
{
snprintf(command, sizeof(command), "set ?%s\n", np->data);
#ifdef USE_HCACHE
if (hc)
{
- const char *key;
+ const char *key = NULL;
size_t keylen;
if (ctx->magic == MUTT_MH)
{
#ifdef USE_HCACHE
if (hc && h->changed)
{
- const char *key;
+ const char *key = NULL;
size_t keylen;
if (ctx->magic == MUTT_MH)
{
struct Address *a = NULL;
for (; optind < argc; optind++)
mutt_list_insert_tail(&alias_queries, mutt_str_strdup(argv[optind]));
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &alias_queries, entries)
{
a = mutt_alias_lookup(np->data);
while (a && a->next)
a = a->next;
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &attach, entries)
{
if (a)
*/
struct ListNode *mutt_list_find(struct ListHead *h, const char *data)
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, h, entries)
{
if (np->data == data || mutt_str_strcmp(np->data, data) == 0)
*/
bool mutt_list_match(const char *s, struct ListHead *h)
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, h, entries)
{
if ((*np->data == '*') || (mutt_str_strncasecmp(s, np->data, strlen(np->data)) == 0))
struct Buffer buf = { 0 }; /* Output buffer */
char *s = *pd; /* Read pointer */
- char *beg; /* Begin of encoded word */
+ char *beg = NULL; /* Begin of encoded word */
enum ContentEncoding enc; /* ENCBASE64 or ENCQUOTEDPRINTABLE */
- char *charset; /* Which charset */
+ char *charset = NULL; /* Which charset */
size_t charsetlen; /* Length of the charset */
- char *text; /* Encoded text */
+ char *text = NULL; /* Encoded text */
size_t textlen; /* Length of encoded text */
/* Keep some state in case the next decoded word is using the same charset
/* Some encoded text was found */
text[textlen] = '\0';
char *decoded = rfc2047_decode_word(text, textlen, enc);
- if (decoded == NULL)
+ if (!decoded)
{
return;
}
*/
void mutt_check_lookup_list(struct Body *b, char *type, size_t len)
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &MimeLookupList, entries)
{
const int i = mutt_str_strlen(np->data) - 1;
env = cur->message->env;
if (env->real_subj && ((env->real_subj != env->subject) || (!SortRe)))
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, subjects, entries)
{
rc = mutt_str_strcmp(env->real_subj, np->data);
make_subject_list(&subjects, cur, &date);
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, &subjects, entries)
{
for (ptr = mutt_hash_find_bucket(ctx->subj_hash, np->data); ptr; ptr = ptr->next)
static void free_recipient_set(gpgme_key_t **p_rset)
{
- gpgme_key_t *rset;
+ gpgme_key_t *rset = NULL;
if (!p_rset)
return;
size_t n;
n = 0;
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, list, entries)
{
for (s = np->data; *s; s++)
escaped pappert but simple strings passed in an array to the
keylist_ext_start function. */
size_t n = 0;
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, hints, entries)
{
if (np->data && *np->data)
*uids = '\0';
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, hints, entries)
{
mutt_file_quote_filename(quoted, sizeof(quoted), (char *) np->data);
char buf[LONG_STRING], certfile[PATH_MAX];
char tempfile[PATH_MAX];
char smimeinfile[PATH_MAX];
- char *cert_start, *cert_end;
+ char *cert_end = NULL;
FILE *smimein = NULL;
int err = 0, empty, off;
pid_t thepid;
}
*certfile = '\0';
- for (cert_start = certlist; cert_start; cert_start = cert_end)
+ for (char *cert_start = certlist; cert_start; cert_start = cert_end)
{
cert_end = strchr(cert_start, ' ');
if (cert_end)
return false;
}
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, checklist, entries)
{
a = (struct AttachMatch *) np->data;
*/
static bool match_reference(struct Pattern *pat, struct ListHead *refs)
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, refs, entries)
{
if (patmatch(pat, np->data) == 0)
struct MixChain *chain = mutt_mem_calloc(1, sizeof(struct MixChain));
- struct ListNode *p;
+ struct ListNode *p = NULL;
STAILQ_FOREACH(p, chainhead, entries)
{
mix_chain_add(chain, p->data, type2_list);
snprintf(cmd, sizeof(cmd), "cat %s | %s -m ", tempfile, Mixmaster);
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, chain, entries)
{
mutt_str_strfcpy(tmp, cmd, sizeof(tmp));
mutt_str_strfcpy(attribute, par->attribute, sizeof(attribute));
const bool encoded = par->encoded;
- char *valp;
+ char *valp = NULL;
if (encoded)
valp = rfc2231_get_charset(par->value, charset, sizeof(charset));
else
const char *p = NULL;
buf[0] = 0;
- struct ListNode *uh;
+ struct ListNode *uh = NULL;
STAILQ_FOREACH(uh, &UserHeader, entries)
{
if (mutt_str_strncasecmp("subject:", uh->data, 8) == 0)
static void process_user_recips(struct Envelope *env)
{
- struct ListNode *uh;
+ struct ListNode *uh = NULL;
STAILQ_FOREACH(uh, &UserHeader, entries)
{
if (mutt_str_strncasecmp("to:", uh->data, 3) == 0)
static void process_user_header(struct Envelope *env)
{
- struct ListNode *uh;
+ struct ListNode *uh = NULL;
STAILQ_FOREACH(uh, &UserHeader, entries)
{
if (mutt_str_strncasecmp("from:", uh->data, 5) == 0)
*/
static void add_references(struct ListHead *head, struct Envelope *e)
{
- struct ListHead *src;
- struct ListNode *np;
+ struct ListHead *src = NULL;
+ struct ListNode *np = NULL;
src = !STAILQ_EMPTY(&e->references) ? &e->references : &e->in_reply_to;
STAILQ_FOREACH(np, src, entries)
{
size_t len = 25 + mutt_str_strlen(a->subtype); /* approximate len. of content-type */
- struct Parameter *np;
+ struct Parameter *np = NULL;
TAILQ_FOREACH(np, &a->parameter, entries)
{
char *tmp = NULL;
*/
void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim)
{
- struct ListNode *np;
+ struct ListNode *np = NULL;
size_t length = 0;
STAILQ_FOREACH(np, r, entries)
}
/* Add any user defined headers */
- struct ListNode *tmp;
+ struct ListNode *tmp = NULL;
STAILQ_FOREACH(tmp, &env->userhdrs, entries)
{
p = strchr(tmp->data, ':');
char *p = NULL;
int i;
- struct ListNode *np;
+ struct ListNode *np = NULL;
STAILQ_FOREACH(np, h, entries)
{
p = strchr(np->data, ':');
*/
void mutt_unprepare_envelope(struct Envelope *env)
{
- struct ListNode *item;
+ struct ListNode *item = NULL;
STAILQ_FOREACH(item, &env->userhdrs, entries)
{
mutt_rfc2047_decode(&item->data);
if (post && !STAILQ_EMPTY(&hdr->chain))
{
fputs("X-Mutt-Mix:", msg->fp);
- struct ListNode *p;
+ struct ListNode *p = NULL;
STAILQ_FOREACH(p, &hdr->chain, entries)
{
fprintf(msg->fp, " %s", (char *) p->data);