From fa5cfa70af58e212a9817647fc89522882a2af4b Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Wed, 21 Feb 2018 01:19:34 +0000 Subject: [PATCH] unused variables These variables set then either - overwritten before being used - not used before going out of scope --- address.c | 5 +---- enter.c | 1 - handler.c | 2 -- help.c | 2 +- imap/imap.c | 4 +--- mutt_notmuch.c | 3 +-- muttlib.c | 4 ---- ncrypt/pgpkey.c | 1 - pager.c | 2 +- recvcmd.c | 1 - send.c | 1 - 11 files changed, 5 insertions(+), 21 deletions(-) diff --git a/address.c b/address.c index 47515000c..328105194 100644 --- a/address.c +++ b/address.c @@ -495,7 +495,7 @@ void mutt_addr_free(struct Address **p) */ struct Address *mutt_addr_parse_list(struct Address *top, const char *s) { - int ws_pending, nl; + int ws_pending; const char *ps = NULL; char comment[LONG_STRING], phrase[LONG_STRING]; size_t phraselen = 0, commentlen = 0; @@ -508,9 +508,6 @@ struct Address *mutt_addr_parse_list(struct Address *top, const char *s) last = last->next; ws_pending = mutt_str_is_email_wsp(*s); - nl = mutt_str_strlen(s); - if (nl) - nl = s[nl - 1] == '\n'; s = mutt_str_skip_email_wsp(s); while (*s) diff --git a/enter.c b/enter.c index 82865b91d..dfc6c370d 100644 --- a/enter.c +++ b/enter.c @@ -632,7 +632,6 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul else if (flags & MUTT_NM_TAG) { mutt_mb_wcstombs(buf, buflen, state->wbuf, state->curpos); - i = strlen(buf); if (!mutt_nm_tag_complete(buf, buflen, state->tabs)) BEEP(); diff --git a/handler.c b/handler.c index d6a77ff18..ff3702aaf 100644 --- a/handler.c +++ b/handler.c @@ -245,8 +245,6 @@ static void decode_quoted(struct State *s, long len, int istext, iconv_t cd) while (len > 0) { - last = 0; - /* * It's ok to use a fixed size buffer for input, even if the line turns * out to be longer than this. Just process the line in chunks. This diff --git a/help.c b/help.c index 159b3e83c..3eec6b609 100644 --- a/help.c +++ b/help.c @@ -225,7 +225,7 @@ static void format_line(FILE *f, int ismacro, const char *t1, const char *t2, co split = (MuttIndexWindow->cols < 40); if (split) { - col_a = col = 0; + col = 0; col_b = LONG_STRING; fputc('\n', f); } diff --git a/imap/imap.c b/imap/imap.c index e1c060cab..48ae5643f 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -225,14 +225,12 @@ static void set_flag(struct ImapData *idata, int aclbit, int flag, static int make_msg_set(struct ImapData *idata, struct Buffer *buf, int flag, bool changed, bool invert, int *pos) { - struct Header **hdrs = idata->ctx->hdrs; int count = 0; /* number of messages in message set */ bool match = false; /* whether current message matches flag condition */ unsigned int setstart = 0; /* start of current message range */ int n; bool started = false; - - hdrs = idata->ctx->hdrs; + struct Header **hdrs = idata->ctx->hdrs; for (n = *pos; n < idata->ctx->msgcount && buf->dptr - buf->data < IMAP_MAX_CMDLEN; n++) { diff --git a/mutt_notmuch.c b/mutt_notmuch.c index d65a7fb1a..553ef767f 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -2374,9 +2374,8 @@ static int nm_open_message(struct Context *ctx, struct Message *msg, int msgno) if (!ctx || !msg) return 1; struct Header *cur = ctx->hdrs[msgno]; - char *folder = ctx->path; char path[_POSIX_PATH_MAX]; - folder = nm_header_get_folder(cur); + char *folder = nm_header_get_folder(cur); snprintf(path, sizeof(path), "%s/%s", folder, cur->path); diff --git a/muttlib.c b/muttlib.c index 7a537212b..aeadb34f2 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1116,9 +1116,6 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c len = mutt_wstr_trunc(tmp, buflen - wlen, cols - col, NULL); memcpy(wptr, tmp, len); wptr += len; - wlen += len; - col += wid; - src += pl; } break; /* skip rest of input */ } @@ -1144,7 +1141,6 @@ void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const c col += pw; c--; } - src += pl; } break; /* skip rest of input */ } diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index ff11f60f4..81ddade13 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -484,7 +484,6 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, bool unusable = false; keymax = 0; - KeyTable = NULL; for (i = 0, kp = keys; kp; kp = kp->next) { diff --git a/pager.c b/pager.c index 28129c56f..932e15d9a 100644 --- a/pager.c +++ b/pager.c @@ -1416,7 +1416,7 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, { unsigned char *buf = NULL, *fmt = NULL; size_t buflen = 0; - unsigned char *buf_ptr = buf; + unsigned char *buf_ptr = NULL; int ch, vch, col, cnt, b_read; int buf_ready = 0; bool change_last = false; diff --git a/recvcmd.c b/recvcmd.c index fe67bd7be..d3d33075a 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -503,7 +503,6 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx { if (mutt_copy_body(fp, last, cur) == -1) goto bail; - last = &((*last)->next); } } else diff --git a/send.c b/send.c index 47aabe47a..07096d24c 100644 --- a/send.c +++ b/send.c @@ -1798,7 +1798,6 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, if (killfrom) { mutt_addr_free(&msg->env->from); - killfrom = false; } } -- 2.40.0