From b6472ccc776162ca2168be022d865751f4ceb94c Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Mon, 21 May 2018 17:05:07 +0100 Subject: [PATCH] fix cppcheck issues --- handler.c | 4 +--- imap/auth_gss.c | 3 +-- ncrypt/pgp.h | 2 +- postpone.c | 3 +-- remailer.h | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/handler.c b/handler.c index 80aeae379..a5724edf5 100644 --- a/handler.c +++ b/handler.c @@ -1593,10 +1593,8 @@ static int external_body_handler(struct Body *b, struct State *s) { if (s->flags & (MUTT_DISPLAY | MUTT_PRINTING)) { - char *length = NULL; char pretty_size[10]; - - length = mutt_param_get(&b->parameter, "length"); + char *length = mutt_param_get(&b->parameter, "length"); if (length) { mutt_str_pretty_size(pretty_size, sizeof(pretty_size), strtol(length, NULL, 10)); diff --git a/imap/auth_gss.c b/imap/auth_gss.c index 23a4e0bb6..6870eeb67 100644 --- a/imap/auth_gss.c +++ b/imap/auth_gss.c @@ -74,7 +74,6 @@ static void print_gss_error(OM_uint32 err_maj, OM_uint32 err_min) gss_buffer_desc status_string; char buf_maj[512]; char buf_min[512]; - size_t status_len; do { @@ -82,7 +81,7 @@ static void print_gss_error(OM_uint32 err_maj, OM_uint32 err_min) GSS_C_NO_OID, &msg_ctx, &status_string); if (GSS_ERROR(maj_stat)) break; - status_len = status_string.length; + size_t status_len = status_string.length; if (status_len >= sizeof(buf_maj)) status_len = sizeof(buf_maj) - 1; strncpy(buf_maj, (char *) status_string.value, status_len); diff --git a/ncrypt/pgp.h b/ncrypt/pgp.h index 752cf1ea2..fa62d72d0 100644 --- a/ncrypt/pgp.h +++ b/ncrypt/pgp.h @@ -40,7 +40,7 @@ struct State; bool pgp_use_gpg_agent(void); -int pgp_check_traditional(FILE *fp, struct Body *b, int tagged_only); +int pgp_check_traditional(FILE *fp, struct Body *b, int just_one); char *pgp_this_keyid(struct PgpKeyInfo *k); char *pgp_keyid(struct PgpKeyInfo *k); diff --git a/postpone.c b/postpone.c index f53391cf2..87e478f89 100644 --- a/postpone.c +++ b/postpone.c @@ -385,10 +385,9 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr, #ifdef MIXMASTER else if (mutt_str_strncmp("X-Mutt-Mix:", np->data, 11) == 0) { - char *t = NULL; mutt_list_free(&hdr->chain); - t = strtok(np->data + 11, " \t\n"); + char *t = strtok(np->data + 11, " \t\n"); while (t) { mutt_list_insert_tail(&hdr->chain, mutt_str_strdup(t)); diff --git a/remailer.h b/remailer.h index fb49a2829..3a69ccf09 100644 --- a/remailer.h +++ b/remailer.h @@ -62,7 +62,7 @@ struct MixChain int mix_send_message(struct ListHead *chain, const char *tempfile); int mix_check_message(struct Header *msg); -void mix_make_chain(struct ListHead *chain); +void mix_make_chain(struct ListHead *chainhead); #endif /* MIXMASTER */ -- 2.40.0