else
mutt_format_s(buf, buflen, prec, "");
}
- else if (!folder->ff->msg_count)
+ else if (folder->ff->msg_count == 0)
optional = 0;
break;
else
mutt_format_s(buf, buflen, prec, "");
}
- else if (!folder->ff->msg_unread)
+ else if (folder->ff->msg_unread == 0)
optional = 0;
break;
if (savedcert)
{
- if (!preauthrc)
+ if (preauthrc == 0)
return 1;
else
break;
}
const size_t len = mutt_str_strlen(buf);
- if (!len)
+ if (len == 0)
return line;
buf += len - 1;
do
{
rc = imap_exec_msgset(m, "UID COPY", dest_mdata->munge_name, MUTT_TRASH, false, false);
- if (!rc)
+ if (rc == 0)
{
mutt_debug(LL_DEBUG1, "No messages to trash\n");
rc = -1;
* flags have changed, so we can set a reopen flag in
* cmd_parse_fetch(). We don't want to count a local modification
* to the header flag as a "change". */
- if ((old_hd_flag == new_hd_flag) && local_changes)
+ if ((old_hd_flag == new_hd_flag) && (local_changes != 0))
return;
if (new_hd_flag == h_flag)
*server_changes = true;
/* Local changes have priority */
- if (!local_changes)
+ if (local_changes == 0)
mutt_set_flag(m, e, flag_name, new_hd_flag);
}
}
rc = imap_exec_msgset(m, "UID COPY", mmbox, MUTT_TAG, false, false);
- if (!rc)
+ if (rc == 0)
{
mutt_debug(LL_DEBUG1, "No messages tagged\n");
rc = -1;
/* this message is now definitively *not* changed (mutt_set_flag
* marks things changed as a side-effect) */
- if (!local_changes)
+ if (local_changes == 0)
e->changed = false;
m->changed &= !readonly;
m->readonly = readonly;
static unsigned short ImapsPort = 0;
struct servent *service = NULL;
- if (!ImapPort)
+ if (ImapPort == 0)
{
service = getservbyname("imap", "tcp");
if (service)
ImapPort = IMAP_PORT;
mutt_debug(LL_DEBUG3, "Using default IMAP port %d\n", ImapPort);
}
- if (!ImapsPort)
+ if (ImapsPort == 0)
{
service = getservbyname("imaps", "tcp");
if (service)
int padding = mx_msg_padding_size(ctx->mailbox);
for (int i = (check == MUTT_REOPENED) ? 0 : oldcount; i < ctx->mailbox->msg_count; i++)
{
- if (!i)
+ if (i == 0)
{
ctx->mailbox->vcount = 0;
ctx->vsize = 0;
return -1;
char ch;
- char qc = 0; /* quote char */
+ char qc = '\0'; /* quote char */
char *pc = NULL;
mutt_buffer_reset(dest);
SKIPWS(tok->dptr);
while ((ch = *tok->dptr))
{
- if (!qc)
+ if (qc == '\0')
{
if ((IS_SPACE(ch) && !(flags & MUTT_TOKEN_SPACE)) ||
((ch == '#') && !(flags & MUTT_TOKEN_COMMENT)) ||
return RESOLVERES_FAIL_NOMAILBOX;
}
- if (!info->magic)
+ if (info->magic == MUTT_UNKNOWN)
{
return RESOLVERES_FAIL_NOMAGIC;
}
char *ob1 = ob;
size_t obl1 = obl;
iconv(cd, (ICONV_CONST char **) &ib1, &ibl1, &ob1, &obl1);
- if (!ibl1)
+ if (ibl1 == 0)
{
ib++;
ibl--;
return ctx;
}
- if (!m->magic)
+ if (m->magic == MUTT_UNKNOWN)
{
m->magic = mx_path_probe(m->path, NULL);
m->mx_ops = mx_get_ops(m->magic);
t |= PGP_KEY;
}
- if (!t)
+ if (t == SEC_NO_FLAGS)
t |= PGP_ENCRYPT; /* not necessarily correct, but... */
}
{
crypt_fetch_signatures(&signatures, a->next, &sigcnt);
- if (sigcnt)
+ if (sigcnt != 0)
{
char tempfile[PATH_MAX];
mutt_mktemp(tempfile, sizeof(tempfile));
rc = mutt_body_handler(a, s);
- if (s->flags & MUTT_DISPLAY && sigcnt)
+ if ((s->flags & MUTT_DISPLAY) && (sigcnt != 0))
state_attach_puts(_("\n[-- End of signed data --]\n"), s);
return rc;
gpgme_ctx_t ctx;
err = gpgme_new(&ctx);
- if (err)
+ if (err != 0)
{
mutt_error(_("error creating gpgme context: %s"), gpgme_strerror(err));
mutt_exit(1);
if (for_smime)
{
err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
- if (err)
+ if (err != 0)
{
mutt_error(_("error enabling CMS protocol: %s"), gpgme_strerror(err));
mutt_exit(1);
gpgme_data_t data;
err = gpgme_data_new(&data);
- if (err)
+ if (err != 0)
{
mutt_error(_("error creating gpgme data object: %s"), gpgme_strerror(err));
mutt_exit(1);
err = gpgme_data_new_from_file(&data, tempfile, 1);
}
unlink(tempfile);
- if (err)
+ if (err != 0)
{
mutt_error(_("error allocating data object: %s"), gpgme_strerror(err));
return NULL;
gpgme_data_t data;
err = gpgme_data_new_from_filepart(&data, NULL, fp, offset, length);
- if (err)
+ if (err != 0)
{
mutt_error(_("error allocating data object: %s"), gpgme_strerror(err));
return NULL;
ssize_t nread;
err = ((gpgme_data_seek(data, 0, SEEK_SET) == -1) ? gpgme_error_from_errno(errno) : 0);
- if (err)
+ if (err != 0)
{
mutt_error(_("error rewinding data object: %s"), gpgme_strerror(err));
return -1;
}
err = ((gpgme_data_seek(data, 0, SEEK_SET) == -1) ? gpgme_error_from_errno(errno) : 0);
- if (!err)
+ if (err == 0)
{
char buf[4096];
buf[i - 1] = '\0';
err = gpgme_get_key(context, buf, &key, 0);
- if (!err)
+ if (err == 0)
key->uids->validity = GPGME_VALIDITY_FULL;
buf[i - 1] = '!';
}
else
err = gpgme_get_key(context, buf, &key, 0);
mutt_mem_realloc(&rset, sizeof(*rset) * (rset_n + 1));
- if (!err)
+ if (err == 0)
rset[rset_n++] = key;
else
{
listctx = create_gpgme_context(for_smime);
err = gpgme_op_keylist_start(listctx, signid, 1);
- if (!err)
+ if (err == 0)
err = gpgme_op_keylist_next(listctx, &key);
if (err)
{
return -1;
}
err = gpgme_op_keylist_next(listctx, &key2);
- if (!err)
+ if (err == 0)
{
gpgme_key_unref(key);
gpgme_key_unref(key2);
if (C_CryptUsePka)
{
err = set_pka_sig_notation(ctx);
- if (err)
+ if (err != 0)
goto cleanup;
}
}
redraw_if_needed(ctx);
- if (err)
+ if (err != 0)
{
mutt_error(_("error encrypting data: %s"), gpgme_strerror(err));
goto cleanup;
if (C_CryptUsePka)
{
err = set_pka_sig_notation(ctx);
- if (err)
+ if (err != 0)
{
gpgme_data_release(signature);
gpgme_data_release(message);
err = gpgme_op_sign(ctx, message, signature, GPGME_SIG_MODE_DETACH);
redraw_if_needed(ctx);
gpgme_data_release(message);
- if (err)
+ if (err != 0)
{
gpgme_data_release(signature);
gpgme_release(ctx);
if (gpg_err_code(sig->status) != GPG_ERR_NO_PUBKEY)
{
err = gpgme_get_key(ctx, fpr, &key, 0); /* secret key? */
- if (!err)
+ if (err == 0)
{
if (!signature_key)
signature_key = key;
if (!s || !s->fp_out || !(s->flags & MUTT_DISPLAY))
; /* No state information so no way to print anything. */
- else if (err)
+ else if (err != 0)
{
char buf[1024];
snprintf(buf, sizeof(buf), _("Error getting key information for KeyID %s: %s\n"),
gpgme_data_set_encoding(signature, GPGME_DATA_ENCODING_BASE64);
err = gpgme_data_new_from_file(&message, tempfile, 1);
- if (err)
+ if (err != 0)
{
gpgme_data_release(signature);
mutt_error(_("error allocating data object: %s"), gpgme_strerror(err));
gpgme_data_release(signature);
redraw_if_needed(ctx);
- if (err)
+ if (err != 0)
{
char buf[200];
}
}
- if (!badsig)
+ if (badsig == 0)
{
gpgme_verify_result_t result;
gpgme_sig_notation_t notation;
else
err = gpgme_op_decrypt(ctx, ciphertext, plaintext);
gpgme_data_release(ciphertext);
- if (err)
+ if (err != 0)
{
if (is_smime && !maybe_signed && (gpg_err_code(err) == GPG_ERR_NO_DATA))
{
{
err = gpgme_op_keylist_start(tmpctx, NULL, 0);
}
- while (!err)
+ while (err == 0)
{
err = gpgme_op_keylist_next(tmpctx, &key);
- if (err)
+ if (err != 0)
break;
uid = key->uids;
subkey = key->subkeys;
}
err = gpgme_op_import(ctx, keydata);
- if (err)
+ if (err != 0)
{
mutt_error(_("Error extracting key: %s"), gpgme_strerror(err));
goto leave;
* would be helpful. */
for (st = impres->imports; st; st = st->next)
{
- if (!st->result)
+ if (st->result == 0)
continue;
printf("key %s import failed: %s\n", NONULL(st->fpr), gpgme_strerror(st->result));
}
}
redraw_if_needed(ctx);
- if (err)
+ if (err != 0)
{
char errbuf[200];
if (!*s)
return NULL; /* error */
n = s - str;
- if (!n)
+ if (n == 0)
return NULL; /* empty key */
array->key = mutt_mem_malloc(n + 1);
p = array->key;
for (s = str; isxdigit(*s); s++)
s++;
n = s - str;
- if (!n || (n & 1))
+ if ((n == 0) || (n & 1))
return NULL; /* empty or odd number of digits */
n /= 2;
p = mutt_mem_malloc(n + 1);
gpgme_user_id_t uid = NULL;
static int max_header_width = 0;
- if (!max_header_width)
+ if (max_header_width == 0)
{
for (int i = 0; i < KIP_MAX; i++)
{
s = uid->uid;
/* L10N: DOTFILL */
- if (!idx)
+ if (idx == 0)
fprintf(fp, "%*s", KeyInfoPadding[KIP_NAME], _(KeyInfoPrompts[KIP_NAME]));
else
fprintf(fp, "%*s", KeyInfoPadding[KIP_AKA], _(KeyInfoPrompts[KIP_AKA]));
err = gpgme_op_keylist_start(listctx, s, 0);
gpgme_key_unref(k);
k = NULL;
- if (!err)
+ if (err == 0)
err = gpgme_op_keylist_next(listctx, &k);
- if (err)
+ if (err != 0)
{
fprintf(fp, _("Error finding issuer key: %s\n"), gpgme_strerror(err));
goto leave;
if (np->data && *np->data)
n++;
}
- if (!n)
+ if (n == 0)
goto no_pgphints;
char **patarr = mutt_mem_calloc(n + 1, sizeof(*patarr));
for (n = 0; patarr[n]; n++)
FREE(&patarr[n]);
FREE(&patarr);
- if (err)
+ if (err != 0)
{
mutt_error(_("gpgme_op_keylist_start failed: %s"), gpgme_strerror(err));
gpgme_release(ctx);
return NULL;
}
- while (!(err = gpgme_op_keylist_next(ctx, &key)))
+ while ((err = gpgme_op_keylist_next(ctx, &key)) == 0)
{
KeyFlags flags = KEYFLAG_NO_FLAGS;
/* and now look for x509 certificates */
gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
err = gpgme_op_keylist_start(ctx, pattern, 0);
- if (err)
+ if (err != 0)
{
mutt_error(_("gpgme_op_keylist_start failed: %s"), gpgme_strerror(err));
gpgme_release(ctx);
return NULL;
}
- while (!(err = gpgme_op_keylist_next(ctx, &key)))
+ while ((err = gpgme_op_keylist_next(ctx, &key)) == 0)
{
KeyFlags flags = KEYFLAG_ISX509;
char *ob = buf;
size_t obl = n;
iconv(cd, (ICONV_CONST char **) &ib, &ibl, &ob, &obl);
- if (!ibl)
+ if (ibl == 0)
{
if (ob - buf < n)
{
mutt_any_key_to_continue(_("Error: unable to create OpenSSL subprocess"));
rc = 1;
}
- else if (!rc)
+ else if (rc == 0)
rc = 1;
else
rc = 0;
if (empty)
{
/* fatal error while trying to encrypt message */
- if (!err)
+ if (err == 0)
mutt_any_key_to_continue(_("No output from OpenSSL..."));
mutt_file_unlink(tempfile);
return NULL;
for (unsigned int j = 0; j < m->msg_count; j++)
if (!m->emails[j]->read && !m->emails[j]->deleted)
unread++;
- if (!unread)
+ if (unread == 0)
continue;
}
mutt_str_strfcpy(buf, mdata->group, buflen);
cont = (chunk >= (buflen - off)) ? 1 : 0;
off += strlen(adata->overview_fmt + off);
- if (!cont)
+ if (cont == 0)
{
char *colon = NULL;
int m;
struct Syntax *matching_chunk = NULL;
- if (!cnt)
+ if (cnt == 0)
last_color = -1; /* force attrset() */
if (line_info[n].continuation)
* with a single long word shouldn't be smartwrapped
* either. So just disable smart_wrap if it would wrap at the
* beginning of the line. */
- if (!ch)
+ if (ch == 0)
buf_ptr = buf + cnt;
else
cnt = ch + 1;
if (!pspec->ready)
{
regerr = regcomp(&pspec->cooked, pspec->raw, REG_EXTENDED);
- if (regerr)
+ if (regerr != 0)
return report_regerror(regerr, &pspec->cooked, err);
pspec->ready = 1;
}
/* Match the pattern buffer against the compiled regex.
* No match means syntax error. */
regerr = regexec(&pspec->cooked, s->dptr, RANGE_RX_GROUPS, pmatch, 0);
- if (regerr)
+ if (regerr != 0)
return report_regerror(regerr, &pspec->cooked, err);
if (!is_context_available(s, pmatch, kind, err))
else if (*s == ')')
{
level--;
- if (!level)
+ if (level == 0)
break;
}
}
case POP_A_SOCKET:
return -1;
case POP_A_UNAVAIL:
- if (!attempts)
+ if (attempts == 0)
mutt_error(_("No authenticators available"));
}
if (!adata->expire)
msg = _("Unable to leave messages on server");
- if (!adata->cmd_top)
+ if (adata->cmd_top == 0)
msg = _("Command TOP is not supported by server");
- if (!adata->cmd_uidl)
+ if (adata->cmd_uidl == 0)
msg = _("Command UIDL is not supported by server");
if (msg && adata->cmd_capa)
{
}
}
- if (!ret)
+ if (ret == 0)
mutt_message(ngettext("Message bounced", "Messages bounced", p));
else
mutt_error(ngettext("Error bouncing message", "Error bouncing messages", p));
if (*curr)
curr++;
- if (!x)
+ if (x == 0)
continue;
path[x] = '\0';
char encoded[11];
size_t ret;
- if (!bctx->size)
+ if (bctx->size == 0)
return;
if (bctx->linelen >= 72)
}
}
- if (!ret)
+ if (ret == 0)
{
/* Find best score */
ret = (size_t)(-1);
{
*tocode = i;
ret = score[i];
- if (!ret)
+ if (ret == 0)
break;
}
}
if (fclose(fp_tmp) != 0)
rc = -1;
/* if there was an error, leave the temp version */
- if (!rc)
+ if (rc == 0)
unlink(tempfile);
}
else
if (url->scheme == U_SMTPS)
account->flags |= MUTT_ACCT_SSL;
- if (!account->port)
+ if (account->port == 0)
{
if (account->flags & MUTT_ACCT_SSL)
account->port = SMTPS_PORT;
else
{
static unsigned short SmtpPort = 0;
- if (!SmtpPort)
+ if (SmtpPort == 0)
{
struct servent *service = getservbyname("smtp", "tcp");
if (service)
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, count);
}
- else if (!count)
+ else if (count == 0)
optional = 0;
break;
}
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, read);
}
- else if (!read)
+ else if (read == 0)
optional = 0;
break;
}