From 328e2e7ee9e77176133f54ff86252f2f59750f8c Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Mon, 27 Mar 2017 17:12:51 +0100 Subject: [PATCH] shadow variables --- browser.c | 46 ++++++++++++++-------------- color.c | 10 +++--- commands.c | 6 ++-- copy.c | 8 ++--- crypt-gpgme.c | 29 +++++++++--------- curs_main.c | 84 +++++++++++++++++++++++++-------------------------- hdrline.c | 10 +++--- headers.c | 8 ++--- init.c | 20 ++++++------ main.c | 6 ++-- menu.c | 6 ++-- muttlib.c | 8 ++--- newsrc.c | 34 ++++++++++----------- nntp.c | 18 +++++------ pgp.c | 6 ++-- pgpkey.c | 14 ++++----- send.c | 8 ++--- sendlib.c | 12 ++++---- url.c | 6 ++-- 19 files changed, 169 insertions(+), 170 deletions(-) diff --git a/browser.c b/browser.c index 5f99cb889..7b67b796a 100644 --- a/browser.c +++ b/browser.c @@ -1051,13 +1051,13 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num else { NNTP_SERVER *nserv = CurrentNewsSrv; - unsigned int i; + unsigned int j; /* default state for news reader mode is browse subscribed newsgroups */ buffy = 0; - for (i = 0; i < nserv->groups_num; i++) + for (j = 0; j < nserv->groups_num; j++) { - NNTP_DATA *nntp_data = nserv->groups_list[i]; + NNTP_DATA *nntp_data = nserv->groups_list[j]; if (nntp_data && nntp_data->subscribed) { buffy = 1; @@ -1422,21 +1422,21 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num if (multiple) { char **tfiles; - int i, j; + int j, k; if (menu->tagged) { *numfiles = menu->tagged; tfiles = safe_calloc (*numfiles, sizeof (char *)); - for (i = 0, j = 0; i < state.entrylen; i++) + for (j = 0, k = 0; j < state.entrylen; j++) { - struct folder_file ff = state.entry[i]; + struct folder_file ff = state.entry[j]; char full[_POSIX_PATH_MAX]; if (ff.tagged) { mutt_concat_path (full, LastDir, ff.name, sizeof (full)); mutt_expand_path (full, sizeof (full)); - tfiles[j++] = safe_strdup (full); + tfiles[k++] = safe_strdup (full); } } *files = tfiles; @@ -1850,10 +1850,10 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num else { BODY *b = NULL; - char buf[_POSIX_PATH_MAX]; + char buf2[_POSIX_PATH_MAX]; - mutt_concat_path (buf, LastDir, state.entry[menu->current].name, sizeof (buf)); - b = mutt_make_file_attach (buf); + mutt_concat_path (buf2, LastDir, state.entry[menu->current].name, sizeof (buf2)); + b = mutt_make_file_attach (buf2); if (b != NULL) { mutt_view_attachment (NULL, b, MUTT_REGULAR, NULL, NULL, 0); @@ -1870,7 +1870,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num case OP_UNCATCHUP: if (option (OPTNEWS)) { - struct folder_file *f = &state.entry[menu->current]; + struct folder_file *ff = &state.entry[menu->current]; int rc; NNTP_DATA *nntp_data = NULL; @@ -1879,9 +1879,9 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num break; if (i == OP_CATCHUP) - nntp_data = mutt_newsgroup_catchup (CurrentNewsSrv, f->name); + nntp_data = mutt_newsgroup_catchup (CurrentNewsSrv, ff->name); else - nntp_data = mutt_newsgroup_uncatchup (CurrentNewsSrv, f->name); + nntp_data = mutt_newsgroup_uncatchup (CurrentNewsSrv, ff->name); if (nntp_data) { @@ -1900,14 +1900,14 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num if (option (OPTNEWS)) { NNTP_SERVER *nserv = CurrentNewsSrv; - unsigned int i; + unsigned int j; if (nntp_newsrc_parse (nserv) < 0) break; - for (i = 0; i < nserv->groups_num; i++) + for (j = 0; j < nserv->groups_num; j++) { - NNTP_DATA *nntp_data = nserv->groups_list[i]; + NNTP_DATA *nntp_data = nserv->groups_list[j]; if (nntp_data) nntp_data->deleted = 1; } @@ -1980,15 +1980,15 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num for ( ; j < state.entrylen; j++) { - struct folder_file *f = &state.entry[j]; + struct folder_file *ff = &state.entry[j]; if (i == OP_BROWSER_SUBSCRIBE || i == OP_BROWSER_UNSUBSCRIBE || - regexec (rx, f->name, 0, NULL, 0) == 0) + regexec (rx, ff->name, 0, NULL, 0) == 0) { if (i == OP_BROWSER_SUBSCRIBE || i == OP_SUBSCRIBE_PATTERN) - nntp_data = mutt_newsgroup_subscribe (nserv, f->name); + nntp_data = mutt_newsgroup_subscribe (nserv, ff->name); else - nntp_data = mutt_newsgroup_unsubscribe (nserv, f->name); + nntp_data = mutt_newsgroup_unsubscribe (nserv, ff->name); } if (i == OP_BROWSER_SUBSCRIBE || i == OP_BROWSER_UNSUBSCRIBE) { @@ -2000,11 +2000,11 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num } if (i == OP_SUBSCRIBE_PATTERN) { - unsigned int i; + unsigned int k; - for (i = 0; nserv && i < nserv->groups_num; i++) + for (k = 0; nserv && k < nserv->groups_num; k++) { - nntp_data = nserv->groups_list[i]; + nntp_data = nserv->groups_list[k]; if (nntp_data && nntp_data->group && !nntp_data->subscribed) { if (regexec (rx, nntp_data->group, 0, NULL, 0) == 0) diff --git a/color.c b/color.c index 7a503d51b..370e525cd 100644 --- a/color.c +++ b/color.c @@ -392,7 +392,7 @@ parse_color_name (const char *s, int *col, int *attr, int is_fg, BUFFER *err) static void -do_uncolor (BUFFER *buf, BUFFER *s, COLOR_LINE **ColorList, +do_uncolor (BUFFER *buf, BUFFER *s, COLOR_LINE **cl, int *do_cache, int parse_uncolor) { COLOR_LINE *tmp = NULL, *last = NULL; @@ -402,7 +402,7 @@ do_uncolor (BUFFER *buf, BUFFER *s, COLOR_LINE **ColorList, mutt_extract_token (buf, s, 0); if (mutt_strcmp ("*", buf->data) == 0) { - for (tmp = *ColorList; tmp; ) + for (tmp = *cl; tmp; ) { if (!*do_cache) { @@ -412,11 +412,11 @@ do_uncolor (BUFFER *buf, BUFFER *s, COLOR_LINE **ColorList, tmp = tmp->next; free_color_line (&last, parse_uncolor); } - *ColorList = NULL; + *cl = NULL; } else { - for (last = NULL, tmp = *ColorList; tmp; last = tmp, tmp = tmp->next) + for (last = NULL, tmp = *cl; tmp; last = tmp, tmp = tmp->next) { if (mutt_strcmp (buf->data, tmp->pattern) == 0) { @@ -432,7 +432,7 @@ do_uncolor (BUFFER *buf, BUFFER *s, COLOR_LINE **ColorList, } else { - *ColorList = tmp->next; + *cl = tmp->next; } free_color_line (&tmp, parse_uncolor); break; diff --git a/commands.c b/commands.c index b6db01306..9ef1cf9bb 100644 --- a/commands.c +++ b/commands.c @@ -874,11 +874,11 @@ int mutt_save_message (HEADER *h, int delete, int decode, int decrypt) #ifdef USE_COMPRESSED if (cm) { - HEADER *h = Context->hdrs[Context->v2r[i]]; + HEADER *h2 = Context->hdrs[Context->v2r[i]]; cm->msg_count++; - if (!h->read) + if (!h2->read) cm->msg_unread++; - if (h->flagged) + if (h2->flagged) cm->msg_flagged++; } #endif diff --git a/copy.c b/copy.c index e4158cc51..c23207c74 100644 --- a/copy.c +++ b/copy.c @@ -428,12 +428,12 @@ mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix) char *folder = nm_header_get_folder(h); if (folder && !(option (OPTWEED) && mutt_matches_ignore ("folder"))) { - char buffer[LONG_STRING]; - strfcpy (buffer, folder, sizeof (buffer)); - mutt_pretty_mailbox (buffer, sizeof (buffer)); + char buf[LONG_STRING]; + strfcpy (buf, folder, sizeof (buf)); + mutt_pretty_mailbox (buf, sizeof (buf)); fputs ("Folder: ", out); - fputs (buffer, out); + fputs (buf, out); fputc ('\n', out); } char *tags = nm_header_get_tags(h); diff --git a/crypt-gpgme.c b/crypt-gpgme.c index c8b262e5e..2b1521fff 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -1167,17 +1167,17 @@ static int show_sig_summary (unsigned long sum, if ((sum & GPGME_SIGSUM_SIG_EXPIRED)) { gpgme_verify_result_t result; - gpgme_signature_t sig; + gpgme_signature_t sig2; unsigned int i; result = gpgme_op_verify_result (ctx); - for (sig = result->signatures, i = 0; sig && (i < idx); - sig = sig->next, i++) + for (sig2 = result->signatures, i = 0; sig2 && (i < idx); + sig2 = sig2->next, i++) ; state_puts (_("Warning: The signature expired at: "), s); - print_time (sig ? sig->exp_timestamp : 0, s); + print_time (sig2 ? sig2->exp_timestamp : 0, s); state_puts ("\n", s); } @@ -1204,20 +1204,20 @@ static int show_sig_summary (unsigned long sum, { const char *t0 = NULL, *t1 = NULL; gpgme_verify_result_t result; - gpgme_signature_t sig; + gpgme_signature_t sig2; unsigned int i; state_puts (_("A system error occurred"), s ); /* Try to figure out some more detailed system error information. */ result = gpgme_op_verify_result (ctx); - for (sig = result->signatures, i = 0; sig && (i < idx); - sig = sig->next, i++) + for (sig2 = result->signatures, i = 0; sig2 && (i < idx); + sig2 = sig2->next, i++) ; - if (sig) + if (sig2) { t0 = ""; - t1 = sig->wrong_key_usage ? "Wrong_Key_Usage" : ""; + t1 = sig2->wrong_key_usage ? "Wrong_Key_Usage" : ""; } if (t0 || t1) @@ -1599,17 +1599,16 @@ static int verify_one (BODY *sigbdy, STATE *s, { gpgme_verify_result_t result; gpgme_sig_notation_t notation; - gpgme_signature_t signature; + gpgme_signature_t sig; int non_pka_notations; result = gpgme_op_verify_result (ctx); if (result) { - for (signature = result->signatures; signature; - signature = signature->next) + for (sig = result->signatures; sig; sig = sig->next) { non_pka_notations = 0; - for (notation = signature->notations; notation; + for (notation = sig->notations; notation; notation = notation->next) if (! is_pka_notation (notation)) non_pka_notations++; @@ -1619,9 +1618,9 @@ static int verify_one (BODY *sigbdy, STATE *s, char buf[SHORT_STRING]; snprintf (buf, sizeof (buf), _("*** Begin Notation (signature by: %s) ***\n"), - signature->fpr); + sig->fpr); state_puts (buf, s); - for (notation = signature->notations; notation; + for (notation = sig->notations; notation; notation = notation->next) { if (is_pka_notation (notation)) diff --git a/curs_main.c b/curs_main.c index 9fa6054af..6b5a55364 100644 --- a/curs_main.c +++ b/curs_main.c @@ -360,15 +360,15 @@ void update_index (MUTTMENU *menu, CONTEXT *ctx, int check, { if (check == MUTT_REOPENED) { - THREAD *h = NULL, *j = NULL; + THREAD *h = NULL, *k = NULL; ctx->collapsed = 0; for (h = ctx->tree; h; h = h->next) { - for (j = h; !j->message; j = j->child) + for (k = h; !k->message; k = k->child) ; - mutt_uncollapse_thread (ctx, j->message); + mutt_uncollapse_thread (ctx, k->message); } mutt_set_virtual (ctx); } @@ -1242,18 +1242,18 @@ int mutt_index_menu (void) } else { - int rc; + int rc2; mutt_message (_("Fetching %s from server..."), buf); - rc = nntp_check_msgid (Context, buf); - if (rc == 0) + rc2 = nntp_check_msgid (Context, buf); + if (rc2 == 0) { hdr = Context->hdrs[Context->msgcount - 1]; mutt_sort_headers (Context, 0); menu->current = hdr->virtual; menu->redraw = REDRAW_FULL; } - else if (rc > 0) + else if (rc2 > 0) mutt_error (_("Article %s not found on the server."), buf); } } @@ -1269,7 +1269,7 @@ int mutt_index_menu (void) { int oldmsgcount = Context->msgcount; int oldindex = CURHDR->index; - int rc = 0; + int rc2 = 0; if (!CURHDR->env->message_id) { @@ -1290,8 +1290,8 @@ int mutt_index_menu (void) { if (hash_find (Context->id_hash, ref->data) == NULL) { - rc = nntp_check_msgid (Context, ref->data); - if (rc < 0) + rc2 = nntp_check_msgid (Context, ref->data); + if (rc2 < 0) break; } @@ -1303,17 +1303,17 @@ int mutt_index_menu (void) } /* fetching all child messages */ - if (rc >= 0) - rc = nntp_check_children (Context, buf); + if (rc2 >= 0) + rc2 = nntp_check_children (Context, buf); /* at least one message has been loaded */ if (Context->msgcount > oldmsgcount) { HEADER *oldcur = CURHDR; HEADER *hdr = NULL; - int i, quiet = Context->quiet; + int k, quiet = Context->quiet; - if (rc < 0) + if (rc2 < 0) Context->quiet = 1; mutt_sort_headers (Context, (op == OP_RECONSTRUCT_THREAD)); Context->quiet = quiet; @@ -1336,11 +1336,11 @@ int mutt_index_menu (void) /* try to restore old position */ else { - for (i = 0; i < Context->msgcount; i++) + for (k = 0; k < Context->msgcount; k++) { - if (Context->hdrs[i]->index == oldindex) + if (Context->hdrs[k]->index == oldindex) { - menu->current = Context->hdrs[i]->virtual; + menu->current = Context->hdrs[k]->virtual; /* as an added courtesy, recenter the menu * with the current entry at the middle of the screen */ menu_check_recenter (menu); @@ -1350,7 +1350,7 @@ int mutt_index_menu (void) } menu->redraw = REDRAW_FULL; } - else if (rc >= 0) + else if (rc2 >= 0) { mutt_error (_("No deleted messages found in the thread.")); /* Similar to OP_MAIN_ENTIRE_THREAD, keep displaying the old message, but @@ -1461,10 +1461,10 @@ int mutt_index_menu (void) mutt_message (_("No limit pattern is in effect.")); else { - char buf[STRING]; + char buf2[STRING]; /* L10N: ask for a limit to apply */ - snprintf (buf, sizeof(buf), _("Limit: %s"),Context->pattern); - mutt_message ("%s", buf); + snprintf (buf2, sizeof(buf2), _("Limit: %s"),Context->pattern); + mutt_message ("%s", buf2); } break; @@ -1477,23 +1477,23 @@ int mutt_index_menu (void) CURHDR->index : -1; if (op == OP_TOGGLE_READ) { - char buf[LONG_STRING]; + char buf2[LONG_STRING]; if (!Context->pattern || (strncmp (Context->pattern, "!~R!~D~s", 8) != 0)) { - snprintf (buf, sizeof (buf), "!~R!~D~s%s", + snprintf (buf2, sizeof (buf2), "!~R!~D~s%s", Context->pattern ? Context->pattern : ".*"); set_option (OPTHIDEREAD); } else { - strfcpy (buf, Context->pattern + 8, sizeof(buf)); - if (!*buf || (strncmp (buf, ".*", 2) == 0)) - snprintf (buf, sizeof(buf), "~A"); + strfcpy (buf2, Context->pattern + 8, sizeof(buf2)); + if (!*buf2 || (strncmp (buf2, ".*", 2) == 0)) + snprintf (buf2, sizeof(buf2), "~A"); unset_option (OPTHIDEREAD); } FREE (&Context->pattern); - Context->pattern = safe_strdup (buf); + Context->pattern = safe_strdup (buf2); } if (((op == OP_LIMIT_CURRENT_THREAD) && mutt_limit_current_thread(CURHDR)) || @@ -1690,8 +1690,8 @@ int mutt_index_menu (void) CHECK_MSGCOUNT; CHECK_READONLY; { - int oldvcount = Context->vcount; - int oldcount = Context->msgcount; + int ovc = Context->vcount; + int oc = Context->msgcount; int check, newidx; HEADER *newhdr = NULL; @@ -1711,7 +1711,7 @@ int mutt_index_menu (void) if ((check = mx_sync_mailbox (Context, &index_hint)) == 0) { - if (newhdr && Context->vcount != oldvcount) + if (newhdr && Context->vcount != ovc) for (j = 0; j < Context->vcount; j++) { if (Context->hdrs[Context->v2r[j]] == newhdr) @@ -1723,7 +1723,7 @@ int mutt_index_menu (void) set_option (OPTSEARCHINVALID); } else if (check == MUTT_NEW_MAIL || check == MUTT_REOPENED) - update_index (menu, Context, check, oldcount, index_hint); + update_index (menu, Context, check, oc, index_hint); /* * do a sanity check even if mx_sync_mailbox failed. @@ -1766,18 +1766,18 @@ int mutt_index_menu (void) #ifdef USE_NOTMUCH case OP_MAIN_ENTIRE_THREAD: { - int oldcount = Context->msgcount; if (Context->magic != MUTT_NOTMUCH) { mutt_message (_("No virtual folder, aborting.")); break; } CHECK_MSGCOUNT; CHECK_VISIBLE; + int oc = Context->msgcount; if (nm_read_entire_thread(Context, CURHDR) < 0) { mutt_message (_("Failed to read thread, aborting.")); break; } - if (oldcount < Context->msgcount) { + if (oc < Context->msgcount) { HEADER *oldcur = CURHDR; if ((Sort & SORT_MASK) == SORT_THREADS) @@ -2077,7 +2077,7 @@ int mutt_index_menu (void) if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw); - int index_hint = Context->hdrs[Context->v2r[menu->current]]->index; + int hint = Context->hdrs[Context->v2r[menu->current]]->index; /* If we are returning to the pager via an index menu redirection, we * need to reset the menu->menu. Otherwise mutt_pop_current_menu() will @@ -2096,7 +2096,7 @@ int mutt_index_menu (void) menu->menu = MENU_PAGER; menu->oldcurrent = menu->current; if (Context) - update_index (menu, Context, MUTT_NEW_MAIL, Context->msgcount, index_hint); + update_index (menu, Context, MUTT_NEW_MAIL, Context->msgcount, hint); continue; @@ -2978,16 +2978,16 @@ int mutt_index_menu (void) if (CURHDR->env->message_id) { char str[STRING], macro[STRING]; - char buf[128]; + char buf2[128]; - buf[0] = '\0'; + buf2[0] = '\0'; /* L10N: This is the prompt for . Whatever they enter will be prefixed by $mark_macro_prefix and will become a macro hotkey to jump to the currently selected message. */ - if (!mutt_get_field (_("Enter macro stroke: "), buf, sizeof(buf), - MUTT_CLEAR) && buf[0]) + if (!mutt_get_field (_("Enter macro stroke: "), buf2, sizeof(buf2), + MUTT_CLEAR) && buf2[0]) { - snprintf(str, sizeof(str), "%s%s", MarkMacroPrefix, buf); + snprintf(str, sizeof(str), "%s%s", MarkMacroPrefix, buf2); snprintf(macro, sizeof(macro), "~i \"%s\"\n", CURHDR->env->message_id); /* L10N: "message hotkey" is the key bindings menu description of a @@ -2997,8 +2997,8 @@ int mutt_index_menu (void) /* L10N: This is echoed after creates a new hotkey macro. %s is the hotkey string ($mark_macro_prefix followed by whatever they typed at the prompt.) */ - snprintf(buf, sizeof(buf), _("Message bound to %s."), str); - mutt_message(buf); + snprintf(buf2, sizeof(buf2), _("Message bound to %s."), str); + mutt_message(buf2); mutt_debug (1, "Mark: %s => %s\n", str, macro); } } diff --git a/hdrline.c b/hdrline.c index 449c332f6..30912f31d 100644 --- a/hdrline.c +++ b/hdrline.c @@ -582,7 +582,7 @@ hdr_format_str (char *dest, const char *cp = NULL; struct tm *tm = NULL; time_t T; - int i = 0, invert = 0; + int j = 0, invert = 0; if (optional && ((op == '[') || (op == '('))) { char *is = NULL; @@ -664,13 +664,13 @@ hdr_format_str (char *dest, default: break; } - i += t; + j += t; } - if (i < 0) - i *= -1; + if (j < 0) + j *= -1; - if (((T > i) || (T < (-1*i))) ^ invert) + if (((T > j) || (T < (-1*j))) ^ invert) optional = 0; break; } diff --git a/headers.c b/headers.c index 006def654..d2f34777d 100644 --- a/headers.c +++ b/headers.c @@ -152,7 +152,7 @@ void mutt_edit_headers (const char *editor, } else if (ascii_strncasecmp ("attach:", cur->data, 7) == 0) { - BODY *body = NULL; + BODY *body2 = NULL; BODY *parts = NULL; size_t l = 0; @@ -174,11 +174,11 @@ void mutt_edit_headers (const char *editor, path[l] = 0; mutt_expand_path (path, sizeof (path)); - if ((body = mutt_make_file_attach (path))) + if ((body2 = mutt_make_file_attach (path))) { - body->description = safe_strdup (p); + body2->description = safe_strdup (p); for (parts = msg->content; parts->next; parts = parts->next) ; - parts->next = body; + parts->next = body2; } else { diff --git a/init.c b/init.c index 7d22d5d33..8aebe65c8 100644 --- a/init.c +++ b/init.c @@ -351,12 +351,12 @@ int mutt_option_set(const struct option_t *val, BUFFER *err) { case DT_RX: { - BUFFER *err = safe_malloc(sizeof(BUFFER)); + BUFFER *err2 = safe_malloc(sizeof(BUFFER)); BUFFER tmp; tmp.data = safe_strdup((char *) val->data); tmp.dsize = strlen((char *) val->data); - if (parse_regex(idx, &tmp, err)) + if (parse_regex(idx, &tmp, err2)) { /* $reply_regexp and $alternates require special treatment */ if (Context && Context->msgcount && @@ -381,7 +381,7 @@ int mutt_option_set(const struct option_t *val, BUFFER *err) } else { - snprintf(err->data, err->dsize, _("%s: Unknown type."), + snprintf(err2->data, err2->dsize, _("%s: Unknown type."), MuttVars[idx].option); return -1; } @@ -391,7 +391,7 @@ int mutt_option_set(const struct option_t *val, BUFFER *err) case DT_SORT: { const struct mapping_t *map = NULL; - BUFFER *err = safe_malloc(sizeof(BUFFER)); + BUFFER *err2 = safe_malloc(sizeof(BUFFER)); switch (MuttVars[idx].type & DT_SUBTYPE_MASK) { @@ -418,13 +418,13 @@ int mutt_option_set(const struct option_t *val, BUFFER *err) if (!map) { - snprintf(err->data, err->dsize, _("%s: Unknown type."), + snprintf(err2->data, err2->dsize, _("%s: Unknown type."), MuttVars[idx].option); return -1; } if (parse_sort((short *) MuttVars[idx].data, (const char *) val->data, - map, err) == -1) + map, err2) == -1) return -1; } break; @@ -3878,7 +3878,7 @@ void mutt_init (int skip_sys_rc, LIST *commands) #ifdef USE_NNTP { FILE *f = NULL; - char *i = NULL; + char *c = NULL; if ((f = safe_fopen (SYSCONFDIR "/nntpserver", "r"))) { @@ -3886,9 +3886,9 @@ void mutt_init (int skip_sys_rc, LIST *commands) fgets (buffer, sizeof (buffer), f); p = buffer; SKIPWS (p); - i = p; - while (*i && (*i != ' ') && (*i != '\t') && (*i != '\r') && (*i != '\n')) i++; - *i = '\0'; + c = p; + while (*c && (*c != ' ') && (*c != '\t') && (*c != '\r') && (*c != '\n')) c++; + *c = '\0'; NewsServer = safe_strdup (p); fclose (f); } diff --git a/main.c b/main.c index a26d96033..f7d0ce6be 100644 --- a/main.c +++ b/main.c @@ -496,7 +496,7 @@ int main (int argc, char **argv, char **environ) { struct stat sb; char fpath[_POSIX_PATH_MAX]; - char msg[STRING]; + char msg2[STRING]; strfcpy (fpath, Maildir, sizeof (fpath)); mutt_expand_path (fpath, sizeof (fpath)); @@ -506,8 +506,8 @@ int main (int argc, char **argv, char **environ) #endif if (stat (fpath, &sb) == -1 && errno == ENOENT) { - snprintf (msg, sizeof (msg), _("%s does not exist. Create it?"), Maildir); - if (mutt_yesorno (msg, MUTT_YES) == MUTT_YES) + snprintf (msg2, sizeof (msg2), _("%s does not exist. Create it?"), Maildir); + if (mutt_yesorno (msg2, MUTT_YES) == MUTT_YES) { if (mkdir (fpath, 0700) == -1 && errno != EEXIST) mutt_error (_("Can't create %s: %s."), Maildir, strerror (errno)); diff --git a/menu.c b/menu.c index 82682859b..273787f39 100644 --- a/menu.c +++ b/menu.c @@ -1190,9 +1190,9 @@ int mutt_menu_loop (MUTTMENU *menu) } else if (menu->max) { - int i = menu->tag (menu, menu->current, -1); - menu->tagged += i; - if (i && option (OPTRESOLVE) && menu->current < menu->max - 1) + int j = menu->tag (menu, menu->current, -1); + menu->tagged += j; + if (j && option (OPTRESOLVE) && menu->current < menu->max - 1) { menu->current++; menu->redraw = REDRAW_MOTION_RESYNCH; diff --git a/muttlib.c b/muttlib.c index 70928d5ed..34a1a7767 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1748,12 +1748,12 @@ FILE *mutt_open_read (const char *path, pid_t *thepid) { /* read from a pipe */ - char *s = safe_strdup (path); + char *p = safe_strdup (path); - s[len - 1] = 0; + p[len - 1] = 0; mutt_endwin (NULL); - *thepid = mutt_create_filter (s, NULL, &f, NULL); - FREE (&s); + *thepid = mutt_create_filter (p, NULL, &f, NULL); + FREE (&p); } else { diff --git a/newsrc.c b/newsrc.c index 8bd4da311..45669cfff 100644 --- a/newsrc.c +++ b/newsrc.c @@ -212,7 +212,7 @@ int nntp_newsrc_parse (NNTP_SERVER *nserv) while (sb.st_size && fgets (line, sb.st_size + 1, nserv->newsrc_fp)) { char *b = NULL, *h = NULL, *p = NULL; - unsigned int subs = 0, i = 1; + unsigned int subs = 0, j = 1; NNTP_DATA *nntp_data = NULL; /* find end of newsgroup name */ @@ -233,12 +233,12 @@ int nntp_newsrc_parse (NNTP_SERVER *nserv) b = p; while (*b) if (*b++ == ',') - i++; - nntp_data->newsrc_ent = safe_calloc (i, sizeof (NEWSRC_ENTRY)); + j++; + nntp_data->newsrc_ent = safe_calloc (j, sizeof (NEWSRC_ENTRY)); nntp_data->subscribed = subs; /* parse entries */ - i = 0; + j = 0; while (p) { b = p; @@ -255,20 +255,20 @@ int nntp_newsrc_parse (NNTP_SERVER *nserv) else h = b; - if (sscanf (b, ANUM, &nntp_data->newsrc_ent[i].first) == 1 && - sscanf (h, ANUM, &nntp_data->newsrc_ent[i].last) == 1) - i++; + if (sscanf (b, ANUM, &nntp_data->newsrc_ent[j].first) == 1 && + sscanf (h, ANUM, &nntp_data->newsrc_ent[j].last) == 1) + j++; } - if (i == 0) + if (j == 0) { - nntp_data->newsrc_ent[i].first = 1; - nntp_data->newsrc_ent[i].last = 0; - i++; + nntp_data->newsrc_ent[j].first = 1; + nntp_data->newsrc_ent[j].last = 0; + j++; } if (nntp_data->lastMessage == 0) - nntp_data->lastMessage = nntp_data->newsrc_ent[i - 1].last; - nntp_data->newsrc_len = i; - safe_realloc (&nntp_data->newsrc_ent, i * sizeof (NEWSRC_ENTRY)); + nntp_data->lastMessage = nntp_data->newsrc_ent[j - 1].last; + nntp_data->newsrc_len = j; + safe_realloc (&nntp_data->newsrc_ent, j * sizeof (NEWSRC_ENTRY)); nntp_group_unread_stat (nntp_data); mutt_debug (2, "nntp_newsrc_parse: %s\n", nntp_data->group); } @@ -1235,10 +1235,10 @@ void nntp_buffy (char *buf, size_t len) if (Context && Context->magic == MUTT_NNTP && (mutt_strcmp (nntp_data->group, ((NNTP_DATA *)Context->data)->group) == 0)) { - unsigned int i, unread = 0; + unsigned int j, unread = 0; - for (i = 0; i < Context->msgcount; i++) - if (!Context->hdrs[i]->read && !Context->hdrs[i]->deleted) + for (j = 0; j < Context->msgcount; j++) + if (!Context->hdrs[j]->read && !Context->hdrs[j]->deleted) unread++; if (!unread) continue; diff --git a/nntp.c b/nntp.c index 2d9745f91..b61e39bf7 100644 --- a/nntp.c +++ b/nntp.c @@ -2146,12 +2146,12 @@ int nntp_active_fetch (NNTP_SERVER *nserv) for (i = 0; i < nserv->groups_num; i++) { - NNTP_DATA *nntp_data = nserv->groups_list[i]; + NNTP_DATA *data = nserv->groups_list[i]; - if (nntp_data && nntp_data->deleted && !nntp_data->newsrc_ent) + if (data && data->deleted && !data->newsrc_ent) { - nntp_delete_group_cache (nntp_data); - hash_delete (nserv->groups_hash, nntp_data->group, NULL, nntp_data_free); + nntp_delete_group_cache (data); + hash_delete (nserv->groups_hash, data->group, NULL, nntp_data_free); nserv->groups_list[i] = NULL; } } @@ -2183,11 +2183,11 @@ int nntp_check_new_groups (NNTP_SERVER *nserv) mutt_message (_("Checking for new messages...")); for (i = 0; i < nserv->groups_num; i++) { - NNTP_DATA *nntp_data = nserv->groups_list[i]; + NNTP_DATA *data = nserv->groups_list[i]; - if (nntp_data && nntp_data->subscribed) + if (data && data->subscribed) { - rc = nntp_group_poll (nntp_data, 1); + rc = nntp_group_poll (data, 1); if (rc < 0) return -1; if (rc > 0) @@ -2247,9 +2247,9 @@ int nntp_check_new_groups (NNTP_SERVER *nserv) MUTT_PROGRESS_MSG, ReadInc, nserv->groups_num - i); for (; i < nserv->groups_num; i++) { - NNTP_DATA *nntp_data = nserv->groups_list[i]; + NNTP_DATA *data = nserv->groups_list[i]; - if (get_description (nntp_data, NULL, NULL) < 0) + if (get_description (data, NULL, NULL) < 0) return -1; mutt_progress_update (&progress, ++count, -1); } diff --git a/pgp.c b/pgp.c index 683f4dbaa..b33874738 100644 --- a/pgp.c +++ b/pgp.c @@ -522,7 +522,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) else if (pgpout) { FGETCONV *fc = NULL; - int c; + int ch; char *expected_charset = gpgcharset && *gpgcharset ? gpgcharset : "utf-8"; mutt_debug (4, "pgp: recoding inline from [%s] to [%s]\n", @@ -531,8 +531,8 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) rewind (pgpout); state_set_prefix (s); fc = fgetconv_open (pgpout, expected_charset, Charset, MUTT_ICONV_HOOK_FROM); - while ((c = fgetconv (fc)) != EOF) - state_prefix_putc (c, s); + while ((ch = fgetconv (fc)) != EOF) + state_prefix_putc (ch, s); fgetconv_close (&fc); } diff --git a/pgpkey.c b/pgpkey.c index e6686b7c8..dabdfc8a4 100644 --- a/pgpkey.c +++ b/pgpkey.c @@ -600,26 +600,26 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, (!pgp_id_is_valid (KeyTable[menu->current]) || !pgp_id_is_strong (KeyTable[menu->current]))) { - char *s = ""; + char *str = ""; char buff[LONG_STRING]; if (KeyTable[menu->current]->flags & KEYFLAG_CANTUSE) - s = N_("ID is expired/disabled/revoked."); + str = N_("ID is expired/disabled/revoked."); else switch (KeyTable[menu->current]->trust & 0x03) { case 0: - s = N_("ID has undefined validity."); + str = N_("ID has undefined validity."); break; case 1: - s = N_("ID is not valid."); + str = N_("ID is not valid."); break; case 2: - s = N_("ID is only marginally valid."); + str = N_("ID is only marginally valid."); break; } - snprintf (buff, sizeof (buff), _("%s Do you really want to use the key?"), - _(s)); + snprintf (buff, sizeof (buff), _("%str Do you really want to use the key?"), + _(str)); if (mutt_yesorno (buff, MUTT_NO) != MUTT_YES) { diff --git a/send.c b/send.c index 27313aa5f..76b83a96c 100644 --- a/send.c +++ b/send.c @@ -910,14 +910,14 @@ generate_body (FILE *tempfp, /* stream for outgoing message */ /* if (WithCrypto && (flags & SENDKEY)) */ else if ((WithCrypto & APPLICATION_PGP) && (flags & SENDKEY)) { - BODY *tmp = NULL; + BODY *b = NULL; if ((WithCrypto & APPLICATION_PGP) - && (tmp = crypt_pgp_make_key_attachment (NULL)) == NULL) + && (b = crypt_pgp_make_key_attachment (NULL)) == NULL) return -1; - tmp->next = msg->content; - msg->content = tmp; + b->next = msg->content; + msg->content = b; } mutt_clear_error (); diff --git a/sendlib.c b/sendlib.c index 98cd4c7be..f6386d327 100644 --- a/sendlib.c +++ b/sendlib.c @@ -133,12 +133,12 @@ static void encode_quoted (FGETCONV * fc, FILE *fout, int istext) } else { - int savechar = line[linelen-1]; + int savechar2 = line[linelen-1]; line[linelen-1] = '='; line[linelen] = 0; fputs (line, fout); - fprintf (fout, "\n=%2.2X", (unsigned char) savechar); + fprintf (fout, "\n=%2.2X", (unsigned char) savechar2); } } else @@ -1675,15 +1675,15 @@ static int fold_one_header (FILE *fp, const char *tag, const char *value, * and fold with tab for readability */ if ((flags & CH_DISPLAY) && fold) { - char *p = buf; - while (*p && (*p == ' ' || *p == '\t')) + char *pc = buf; + while (*pc && (*pc == ' ' || *pc == '\t')) { - p++; + pc++; col--; } if (fputc ('\t', fp) == EOF) return -1; - if (print_val (fp, pfx, p, flags, col) < 0) + if (print_val (fp, pfx, pc, flags, col) < 0) return -1; col += 8; } diff --git a/url.c b/url.c index 8b65b94be..aec7e77d2 100644 --- a/url.c +++ b/url.c @@ -149,11 +149,11 @@ static int ciss_parse_userhost (ciss_url_t *ciss, char *src) if ((p = strchr (t, ':'))) { - int t; + int num; *p++ = '\0'; - if (mutt_atoi (p, &t) < 0 || t < 0 || t > 0xffff) + if (mutt_atoi (p, &num) < 0 || num < 0 || num > 0xffff) return -1; - ciss->port = (unsigned short)t; + ciss->port = (unsigned short)num; } else ciss->port = 0; -- 2.40.0