From 1bf57202164ecfc6719c5481d124632ff3142aa8 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Wed, 17 Jan 2018 23:22:39 +0000 Subject: [PATCH] braces --- browser.c | 2 ++ commands.c | 2 ++ conn/ssl_gnutls.c | 26 ++++++++++++++++++++++++++ copy.c | 2 ++ curs_lib.c | 2 ++ curs_main.c | 4 ++++ enter.c | 4 ++++ flags.c | 2 ++ handler.c | 2 ++ hdrline.c | 4 ++++ hook.c | 2 ++ imap/command.c | 2 ++ imap/imap.c | 2 ++ imap/message.c | 2 ++ imap/utf7.c | 10 ++++++++++ imap/util.c | 2 ++ init.c | 12 ++++++++++++ mbox.c | 2 ++ menu.c | 4 ++++ mh.c | 2 ++ mutt/md5.c | 2 ++ mutt/regex.c | 4 ++++ ncrypt/crypt.c | 2 ++ ncrypt/crypt_gpgme.c | 2 ++ ncrypt/pgp.c | 2 ++ ncrypt/pgpkey.c | 8 ++++++++ ncrypt/pgpmicalg.c | 4 ++++ ncrypt/smime.c | 4 ++++ pager.c | 2 ++ parse.c | 4 ++++ pgppubring.c | 2 ++ pop_auth.c | 6 ++++++ pop_lib.c | 2 ++ recvcmd.c | 2 ++ rfc1524.c | 6 ++++++ send.c | 2 ++ sendlib.c | 4 ++++ smtp.c | 2 ++ 38 files changed, 150 insertions(+) diff --git a/browser.c b/browser.c index b68f82889..a31856814 100644 --- a/browser.c +++ b/browser.c @@ -862,7 +862,9 @@ static int examine_mailboxes(struct Menu *menu, struct BrowserState *state) struct NntpData *nntp_data = nserv->groups_list[i]; if (nntp_data && (nntp_data->new || (nntp_data->subscribed && (nntp_data->unread || !ShowOnlyUnread)))) + { add_folder(menu, state, nntp_data->group, NULL, NULL, NULL, nntp_data); + } } } else diff --git a/commands.c b/commands.c index 526bd1d2f..c182c34c2 100644 --- a/commands.c +++ b/commands.c @@ -523,7 +523,9 @@ void mutt_print_message(struct Header *h) if (query_quadoption(Print, h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES) + { return; + } if (pipe_message(h, PrintCommand, PrintDecode, 1, PrintSplit, "\f") == 0) mutt_message(h ? _("Message printed") : _("Messages printed")); diff --git a/conn/ssl_gnutls.c b/conn/ssl_gnutls.c index 9bda6b7f4..19f903106 100644 --- a/conn/ssl_gnutls.c +++ b/conn/ssl_gnutls.c @@ -655,30 +655,42 @@ static int tls_check_one_certificate(const gnutls_datum_t *certdata, buflen = sizeof(dn_common_name); if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_COMMON_NAME, 0, 0, dn_common_name, &buflen) != 0) + { dn_common_name[0] = '\0'; + } buflen = sizeof(dn_email); if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_PKCS9_EMAIL, 0, 0, dn_email, &buflen) != 0) dn_email[0] = '\0'; buflen = sizeof(dn_organization); if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_ORGANIZATION_NAME, 0, 0, dn_organization, &buflen) != 0) + { dn_organization[0] = '\0'; + } buflen = sizeof(dn_organizational_unit); if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_ORGANIZATIONAL_UNIT_NAME, 0, 0, dn_organizational_unit, &buflen) != 0) + { dn_organizational_unit[0] = '\0'; + } buflen = sizeof(dn_locality); if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_LOCALITY_NAME, 0, 0, dn_locality, &buflen) != 0) + { dn_locality[0] = '\0'; + } buflen = sizeof(dn_province); if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_STATE_OR_PROVINCE_NAME, 0, 0, dn_province, &buflen) != 0) + { dn_province[0] = '\0'; + } buflen = sizeof(dn_country); if (gnutls_x509_crt_get_dn_by_oid(cert, GNUTLS_OID_X520_COUNTRY_NAME, 0, 0, dn_country, &buflen) != 0) + { dn_country[0] = '\0'; + } snprintf(menu->dialog[row++], SHORT_STRING, " %s %s", dn_common_name, dn_email); snprintf(menu->dialog[row++], SHORT_STRING, " %s", dn_organization); @@ -693,31 +705,45 @@ static int tls_check_one_certificate(const gnutls_datum_t *certdata, buflen = sizeof(dn_common_name); if (gnutls_x509_crt_get_issuer_dn_by_oid(cert, GNUTLS_OID_X520_COMMON_NAME, 0, 0, dn_common_name, &buflen) != 0) + { dn_common_name[0] = '\0'; + } buflen = sizeof(dn_email); if (gnutls_x509_crt_get_issuer_dn_by_oid(cert, GNUTLS_OID_PKCS9_EMAIL, 0, 0, dn_email, &buflen) != 0) + { dn_email[0] = '\0'; + } buflen = sizeof(dn_organization); if (gnutls_x509_crt_get_issuer_dn_by_oid(cert, GNUTLS_OID_X520_ORGANIZATION_NAME, 0, 0, dn_organization, &buflen) != 0) + { dn_organization[0] = '\0'; + } buflen = sizeof(dn_organizational_unit); if (gnutls_x509_crt_get_issuer_dn_by_oid(cert, GNUTLS_OID_X520_ORGANIZATIONAL_UNIT_NAME, 0, 0, dn_organizational_unit, &buflen) != 0) + { dn_organizational_unit[0] = '\0'; + } buflen = sizeof(dn_locality); if (gnutls_x509_crt_get_issuer_dn_by_oid(cert, GNUTLS_OID_X520_LOCALITY_NAME, 0, 0, dn_locality, &buflen) != 0) + { dn_locality[0] = '\0'; + } buflen = sizeof(dn_province); if (gnutls_x509_crt_get_issuer_dn_by_oid(cert, GNUTLS_OID_X520_STATE_OR_PROVINCE_NAME, 0, 0, dn_province, &buflen) != 0) + { dn_province[0] = '\0'; + } buflen = sizeof(dn_country); if (gnutls_x509_crt_get_issuer_dn_by_oid(cert, GNUTLS_OID_X520_COUNTRY_NAME, 0, 0, dn_country, &buflen) != 0) + { dn_country[0] = '\0'; + } snprintf(menu->dialog[row++], SHORT_STRING, " %s %s", dn_common_name, dn_email); snprintf(menu->dialog[row++], SHORT_STRING, " %s", dn_organization); diff --git a/copy.c b/copy.c index f07d37ac8..0fe851162 100644 --- a/copy.c +++ b/copy.c @@ -643,7 +643,9 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags, if (mutt_copy_header(fpin, hdr, fpout, chflags, (chflags & CH_PREFIX) ? prefix : NULL) == -1) + { return -1; + } new_offset = ftello(fpout); } diff --git a/curs_lib.c b/curs_lib.c index 0b8d2a65c..751d65b22 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -935,7 +935,9 @@ int mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, int buffy, mutt_unget_event(ch.op ? 0 : ch.ch, ch.op ? ch.op : 0); if (mutt_get_field_full(pc, buf, blen, (buffy ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR, multiple, files, numfiles) != 0) + { buf[0] = '\0'; + } FREE(&pc); #ifdef USE_NOTMUCH if ((flags & MUTT_SEL_VFOLDER) && buf[0] && (strncmp(buf, "notmuch://", 10) != 0)) diff --git a/curs_main.c b/curs_main.c index 1a12583bb..1821703cd 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1688,7 +1688,9 @@ int mutt_index_menu(void) if (mutt_pattern_func(MUTT_UNDELETE, _("Undelete messages matching: ")) == 0) + { menu->redraw |= REDRAW_INDEX | REDRAW_STATUS; + } break; case OP_MAIN_UNTAG_PATTERN: @@ -1766,6 +1768,7 @@ int mutt_index_menu(void) if (check == 0) { if (newhdr && Context->vcount != ovc) + { for (j = 0; j < Context->vcount; j++) { if (Context->hdrs[Context->v2r[j]] == newhdr) @@ -1774,6 +1777,7 @@ int mutt_index_menu(void) break; } } + } OPT_SEARCH_INVALID = true; } else if (check == MUTT_NEW_MAIL || check == MUTT_REOPENED) diff --git a/enter.c b/enter.c index 11ae63b48..35b2b9c27 100644 --- a/enter.c +++ b/enter.c @@ -318,7 +318,9 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul state->curpos++; while (state->curpos < state->lastchar && COMB_CHAR(state->wbuf[state->curpos])) + { state->curpos++; + } } break; @@ -343,7 +345,9 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul state->curpos++; while (state->curpos < state->lastchar && !iswspace(state->wbuf[state->curpos])) + { state->curpos++; + } } break; diff --git a/flags.c b/flags.c index 3ea383aa3..97b6cb023 100644 --- a/flags.c +++ b/flags.c @@ -326,7 +326,9 @@ void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, int b */ if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged || flagged != ctx->flagged)) + { h->searched = false; + } } /** diff --git a/handler.c b/handler.c index 4c15aa302..7b5269fea 100644 --- a/handler.c +++ b/handler.c @@ -1942,7 +1942,9 @@ int mutt_body_handler(struct Body *b, struct State *s) if (km_expand_key(keystroke, sizeof(keystroke), km_find_func(MENU_PAGER, OP_VIEW_ATTACHMENTS))) + { fprintf(s->fpout, _("(use '%s' to view this part)"), keystroke); + } else fputs(_("(need 'view-attachments' bound to key!)"), s->fpout); } diff --git a/hdrline.c b/hdrline.c index 7d11324e5..d88266549 100644 --- a/hdrline.c +++ b/hdrline.c @@ -1184,11 +1184,15 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co htmp = NULL; if (flags & MUTT_FORMAT_TREE && (hdr->thread->prev && hdr->thread->prev->message && hdr->thread->prev->message->env->x_label)) + { htmp = hdr->thread->prev->message; + } else if (flags & MUTT_FORMAT_TREE && (hdr->thread->parent && hdr->thread->parent->message && hdr->thread->parent->message->env->x_label)) + { htmp = hdr->thread->parent->message; + } if (htmp && (mutt_str_strcasecmp(hdr->env->x_label, htmp->env->x_label) == 0)) i = 0; } diff --git a/hook.c b/hook.c index 764da1dc2..687f93e8d 100644 --- a/hook.c +++ b/hook.c @@ -529,7 +529,9 @@ static void list_hook(struct ListHead *matches, const char *match, int hook) { if ((tmp->type & hook) && ((match && regexec(tmp->regex.regex, match, 0, NULL, 0) == 0) ^ tmp->regex.not)) + { mutt_list_insert_tail(matches, mutt_str_strdup(tmp->command)); + } } } diff --git a/imap/command.c b/imap/command.c index 5fd774eb7..cddeadd24 100644 --- a/imap/command.c +++ b/imap/command.c @@ -758,8 +758,10 @@ static void cmd_parse_status(struct ImapData *idata, char *s) new = (status->unseen > 0); } else if (!olduv && !oldun) + { /* first check per session, use recent. might need a flag for this. */ new = (status->recent > 0); + } else new = (status->unseen > 0); } diff --git a/imap/imap.c b/imap/imap.c index 95751760a..e1c060cab 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -239,6 +239,7 @@ static int make_msg_set(struct ImapData *idata, struct Buffer *buf, int flag, match = false; /* don't include pending expunged messages */ if (hdrs[n]->active) + { switch (flag) { case MUTT_DELETED: @@ -271,6 +272,7 @@ static int make_msg_set(struct ImapData *idata, struct Buffer *buf, int flag, match = true; break; } + } if (match && (!changed || hdrs[n]->changed)) { diff --git a/imap/message.c b/imap/message.c index aedb5baa4..34e431765 100644 --- a/imap/message.c +++ b/imap/message.c @@ -1123,7 +1123,9 @@ int imap_fetch_message(struct Context *ctx, struct Message *msg, int msgno) } if (imap_read_literal(msg->fp, idata, bytes, output_progress ? &progressbar : NULL) < 0) + { goto bail; + } /* pick up trailing line */ rc = imap_cmd_step(idata); if (rc != IMAP_CMD_CONTINUE) diff --git a/imap/utf7.c b/imap/utf7.c index 5da5d6a2f..c5c5e1ee7 100644 --- a/imap/utf7.c +++ b/imap/utf7.c @@ -122,8 +122,10 @@ static char *utf7_to_utf8(const char *u7, size_t u7len, char **u8, size_t *u8len if (ch < 0x80) { if (0x20 <= ch && ch < 0x7f) + { /* Printable US-ASCII */ goto bail; + } *p++ = ch; } else if (ch < 0x800) @@ -142,18 +144,26 @@ static char *utf7_to_utf8(const char *u7, size_t u7len, char **u8, size_t *u8len } } if (ch || k < 6) + { /* Non-zero or too many extra bits */ goto bail; + } if (!u7len || *u7 != '-') + { /* BASE64 not properly terminated */ goto bail; + } if (u7len > 2 && u7[1] == '&' && u7[2] != '-') + { /* Adjacent BASE64 sections */ goto bail; + } } else if (*u7 < 0x20 || *u7 >= 0x7f) + { /* Not printable US-ASCII */ goto bail; + } else *p++ = *u7; } diff --git a/imap/util.c b/imap/util.c index e18c16661..cb1d86b69 100644 --- a/imap/util.c +++ b/imap/util.c @@ -681,7 +681,9 @@ char *imap_fix_path(struct ImapData *idata, const char *mailbox, char *path, siz while (*mailbox && ((ImapDelimChars && strchr(ImapDelimChars, *mailbox)) || (delim && *mailbox == delim))) + { mailbox++; + } path[i] = delim; } else diff --git a/init.c b/init.c index b4ec94dda..53a197df3 100644 --- a/init.c +++ b/init.c @@ -3313,8 +3313,10 @@ int mutt_command_complete(char *buffer, size_t len, int pos, int numtabs) if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) + { /* cycle thru all the matches */ snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % NumMatched]); + } /* return the completed command */ strncpy(buffer, Completed, len - spaces); @@ -3368,8 +3370,10 @@ int mutt_command_complete(char *buffer, size_t len, int pos, int numtabs) if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) + { /* cycle thru all the matches */ snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % NumMatched]); + } strncpy(pt, Completed, buffer + len - pt - spaces); } @@ -3414,8 +3418,10 @@ int mutt_command_complete(char *buffer, size_t len, int pos, int numtabs) if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) + { /* cycle thru all the matches */ snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % NumMatched]); + } strncpy(pt, Completed, buffer + len - pt - spaces); } @@ -3568,8 +3574,10 @@ bool mutt_nm_query_complete(char *buffer, size_t len, int pos, int numtabs) if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) + { /* cycle thru all the matches */ snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % NumMatched]); + } /* return the completed query */ strncpy(pt, Completed, buffer + len - pt - spaces); @@ -3621,8 +3629,10 @@ bool mutt_nm_tag_complete(char *buffer, size_t len, int numtabs) if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) + { /* cycle thru all the matches */ snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % NumMatched]); + } /* return the completed query */ strncpy(pt, Completed, buffer + len - pt); @@ -4516,8 +4526,10 @@ int mutt_label_complete(char *buffer, size_t len, int numtabs) if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) + { /* cycle thru all the matches */ snprintf(Completed, sizeof(Completed), "%s", Matches[(numtabs - 2) % NumMatched]); + } /* return the completed label */ strncpy(buffer, Completed, len - spaces); diff --git a/mbox.c b/mbox.c index dc6eabc2c..4911da945 100644 --- a/mbox.c +++ b/mbox.c @@ -991,8 +991,10 @@ static int mbox_sync_mailbox(struct Context *ctx, int *index_hint) goto bail; } else if (i < 0) + { /* fatal error */ return -1; + } /* Create a temporary file to write the new version of the mailbox in. */ mutt_mktemp(tempfile, sizeof(tempfile)); diff --git a/menu.c b/menu.c index cbc05f137..04e83edff 100644 --- a/menu.c +++ b/menu.c @@ -623,7 +623,9 @@ static void menu_length_jump(struct Menu *menu, int jumplen) /* need to move the cursor? */ if ((DIRECTION * (tmp = (menu->current - (menu->top + (neg ? (menu->pagelen - 1) - c : c))))) < 0) + { menu->current -= tmp; + } menu->redraw = REDRAW_INDEX; } @@ -633,8 +635,10 @@ static void menu_length_jump(struct Menu *menu, int jumplen) menu->redraw = REDRAW_MOTION; } else + { mutt_error(neg ? _("You are on the first page.") : _("You are on the last page.")); + } menu->current = MIN(menu->current, menu->max - 1); menu->current = MAX(menu->current, 0); diff --git a/mh.c b/mh.c index a9ac0c223..778766e8d 100644 --- a/mh.c +++ b/mh.c @@ -2137,11 +2137,13 @@ static int maildir_check_mailbox(struct Context *ctx, int *index_hint) flags_changed = true; if (ctx->hdrs[i]->deleted == ctx->hdrs[i]->trash) + { if (ctx->hdrs[i]->deleted != p->h->deleted) { ctx->hdrs[i]->deleted = p->h->deleted; flags_changed = true; } + } ctx->hdrs[i]->trash = p->h->trash; /* this is a duplicate of an existing header, so remove it */ diff --git a/mutt/md5.c b/mutt/md5.c index cd7f0230b..1f7639586 100644 --- a/mutt/md5.c +++ b/mutt/md5.c @@ -282,12 +282,14 @@ void mutt_md5_process_bytes(const void *buffer, size_t len, struct Md5Ctx *ctx) #define alignof(type) offsetof(struct { char c; type x; }, x) #define UNALIGNED_P(p) (((size_t) p) % alignof(md5_uint32) != 0) if (UNALIGNED_P(buffer)) + { while (len > 64) { mutt_md5_process_block(memcpy(ctx->buffer, buffer, 64), 64, ctx); buffer = (const char *) buffer + 64; len -= 64; } + } else #endif { diff --git a/mutt/regex.c b/mutt/regex.c index 790b17f6a..ebb8c6142 100644 --- a/mutt/regex.c +++ b/mutt/regex.c @@ -462,7 +462,9 @@ char *mutt_replacelist_apply(struct ReplaceList *rl, char *buf, size_t buflen, c p++; for (int i = pmatch[n].rm_so; (i < pmatch[n].rm_eo) && (tlen < LONG_STRING - 1); i++) + { dst[tlen++] = src[i]; + } } } else @@ -562,7 +564,9 @@ bool mutt_replacelist_match(struct ReplaceList *rl, char *buf, size_t buflen, co int idx; for (idx = pmatch[n].rm_so; (idx < pmatch[n].rm_eo) && (tlen < buflen - 1); ++idx) + { buf[tlen++] = str[idx]; + } } p = e; /* skip over the parsed integer */ } diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index 090c5f7b5..eb506f58c 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -450,7 +450,9 @@ int mutt_is_application_pgp(struct Body *m) p = mutt_param_get("x-action", m->parameter); if (p && ((mutt_str_strcasecmp(p, "sign") == 0) || (mutt_str_strcasecmp(p, "signclear") == 0))) + { t |= PGPSIGN; + } p = mutt_param_get("format", m->parameter); if (p && (mutt_str_strcasecmp(p, "keys-only") == 0)) diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 47f256fd9..ef659c7bf 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -199,8 +199,10 @@ static const char *crypt_keyid(struct CryptKeyInfo *k) { s = k->kobj->subkeys->keyid; if ((!PgpLongIds) && (strlen(s) == 16)) + { /* Return only the short keyID. */ s += 8; + } } return s; diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index c64919375..7a76cfce1 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -81,8 +81,10 @@ int pgp_valid_passphrase(void) } if (now < PgpExptime) + { /* Use cached copy. */ return 1; + } pgp_void_passphrase(); diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 847f5a4dc..c41e8fd8e 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -280,8 +280,10 @@ static const char *pgp_entry_fmt(char *buf, size_t buflen, size_t col, int cols, snprintf(buf, buflen, fmt, trust_flags[uid->trust & 0x03]); } else if (!(uid->trust & 0x03)) + { /* undefined trust */ optional = 0; + } break; default: *buf = '\0'; @@ -451,11 +453,15 @@ static int pgp_id_matches_addr(struct Address *addr, struct Address *u_addr, str if (addr->mailbox && u_addr->mailbox && (mutt_str_strcasecmp(addr->mailbox, u_addr->mailbox) == 0)) + { rc |= PGP_KV_ADDR; + } if (addr->personal && u_addr->personal && (mutt_str_strcasecmp(addr->personal, u_addr->personal) == 0)) + { rc |= PGP_KV_STRING; + } return rc; } @@ -617,11 +623,13 @@ static struct PgpKeyInfo *pgp_select_key(struct PgpKeyInfo *keys, /* XXX make error reporting more verbose */ if (OPT_PGP_CHECK_TRUST) + { if (!pgp_key_is_valid(KeyTable[menu->current]->parent)) { mutt_error(_("This key can't be used: expired/disabled/revoked.")); break; } + } if (OPT_PGP_CHECK_TRUST && (!pgp_id_is_valid(KeyTable[menu->current]) || !pgp_id_is_strong(KeyTable[menu->current]))) diff --git a/ncrypt/pgpmicalg.c b/ncrypt/pgpmicalg.c index 2086d7a44..071604801 100644 --- a/ncrypt/pgpmicalg.c +++ b/ncrypt/pgpmicalg.c @@ -140,11 +140,15 @@ static short pgp_mic_from_packet(unsigned char *p, size_t len) } if (len >= 18 && p[1] == 3) + { /* version 3 signature */ return (short) p[17]; + } else if (len >= 5 && p[1] == 4) + { /* version 4 signature */ return (short) p[4]; + } else { mutt_debug(1, "Bad signature packet.\n"); diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 58e7b6cd1..3e1433ec5 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -130,8 +130,10 @@ int smime_valid_passphrase(void) time_t now = time(NULL); if (now < SmimeExptime) + { /* Use cached copy. */ return 1; + } smime_void_passphrase(); @@ -811,7 +813,9 @@ static void getkeys(char *mailbox) { if (mutt_str_strcasecmp(SmimeDefaultKey, SmimeKeyToUse + mutt_str_strlen(SmimeKeys) + 1) == 0) + { return; + } smime_void_passphrase(); } diff --git a/pager.c b/pager.c index 3674d5a86..89e691d28 100644 --- a/pager.c +++ b/pager.c @@ -1578,9 +1578,11 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct Line **line_info, cnt = ch + 1; } if (!(flags & MUTT_PAGER_NSKIP)) + { /* skip leading blanks on the next line too */ while (*buf_ptr == ' ' || *buf_ptr == '\t') buf_ptr++; + } } if (*buf_ptr == '\r') diff --git a/parse.c b/parse.c index df3a27a6e..c0b92045d 100644 --- a/parse.c +++ b/parse.c @@ -722,11 +722,15 @@ char *mutt_extract_message_id(const char *s, const char **saveptr) /* some idiotic clients break their message-ids between lines */ if (s == p) + { /* step past another whitespace */ s = p + 1; + } else if (o) + { /* more than two lines, give up */ s = o = onull = NULL; + } else { /* remember the first line, start looking for the second */ diff --git a/pgppubring.c b/pgppubring.c index 1abb3645a..7e608245d 100644 --- a/pgppubring.c +++ b/pgppubring.c @@ -394,7 +394,9 @@ static struct PgpKeyInfo *pgp_parse_pgp3_key(unsigned char *buf, size_t l) { for (id = 0, i = SHA_DIGEST_LENGTH - 8 + k * 4; i < SHA_DIGEST_LENGTH + (k - 1) * 4; i++) + { id = (id << 8) + digest[i]; + } snprintf((char *) scratch + k * 8, sizeof(scratch) - k * 8, "%08lX", id); } diff --git a/pop_auth.c b/pop_auth.c index d3183d2d9..598c9b842 100644 --- a/pop_auth.c +++ b/pop_auth.c @@ -124,6 +124,7 @@ static enum PopAuthRes pop_auth_sasl(struct PopData *pop_data, const char *metho } if (!client_start) + { while (true) { rc = sasl_client_step(saslconn, buf, len, &interaction, &pc, &olen); @@ -131,6 +132,7 @@ static enum PopAuthRes pop_auth_sasl(struct PopData *pop_data, const char *metho break; mutt_sasl_interact(interaction); } + } else { olen = client_start; @@ -366,6 +368,7 @@ int pop_authenticate(struct PopData *pop_data) { ret = authenticator->authenticate(pop_data, method); if (ret == POP_A_SOCKET) + { switch (pop_connect(pop_data)) { case 0: @@ -376,6 +379,7 @@ int pop_authenticate(struct PopData *pop_data) case -2: ret = POP_A_FAILURE; } + } if (ret != POP_A_UNAVAIL) attempts++; @@ -404,6 +408,7 @@ int pop_authenticate(struct PopData *pop_data) { ret = authenticator->authenticate(pop_data, authenticator->method); if (ret == POP_A_SOCKET) + { switch (pop_connect(pop_data)) { case 0: @@ -414,6 +419,7 @@ int pop_authenticate(struct PopData *pop_data) case -2: ret = POP_A_FAILURE; } + } if (ret != POP_A_UNAVAIL) attempts++; diff --git a/pop_lib.c b/pop_lib.c index 049400977..d4aa4ca7a 100644 --- a/pop_lib.c +++ b/pop_lib.c @@ -644,6 +644,8 @@ int pop_reconnect(struct Context *ctx) if (query_quadoption(PopReconnect, _("Connection lost. Reconnect to POP server?")) != MUTT_YES) + { return -1; + } } } diff --git a/recvcmd.c b/recvcmd.c index a3c79ee24..fe67bd7be 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -948,5 +948,7 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx, if (ci_send_message(flags, tmphdr, tmpbody, NULL, parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL)) == 0) + { mutt_set_flag(Context, hdr, MUTT_REPLIED, 1); + } } diff --git a/rfc1524.c b/rfc1524.c index fc65db744..260b7a668 100644 --- a/rfc1524.c +++ b/rfc1524.c @@ -259,19 +259,25 @@ static int rfc1524_mailcap_parse(struct Body *a, char *filename, char *type, /* this compare most occur before compose to match correctly */ if (get_field_text(field + 12, entry ? &entry->composetypecommand : NULL, type, filename, line)) + { composecommand = true; + } } else if (mutt_str_strncasecmp(field, "compose", 7) == 0) { if (get_field_text(field + 7, entry ? &entry->composecommand : NULL, type, filename, line)) + { composecommand = true; + } } else if (mutt_str_strncasecmp(field, "print", 5) == 0) { if (get_field_text(field + 5, entry ? &entry->printcommand : NULL, type, filename, line)) + { printcommand = true; + } } else if (mutt_str_strncasecmp(field, "edit", 4) == 0) { diff --git a/send.c b/send.c index da3400ad0..95033c972 100644 --- a/send.c +++ b/send.c @@ -265,7 +265,9 @@ static int edit_envelope(struct Envelope *en, int flags) return -1; if (ReplyWithXorig && (flags & (SENDREPLY | SENDLISTREPLY | SENDGROUPREPLY)) && (edit_address(&en->from, "From: ") == -1)) + { return -1; + } } if (en->subject) diff --git a/sendlib.c b/sendlib.c index 9aedea59b..139d77f4e 100644 --- a/sendlib.c +++ b/sendlib.c @@ -749,13 +749,17 @@ static size_t convert_file_to(FILE *file, const char *fromcode, int ncodes, } } else if (cd[i] == (iconv_t)(-1) && score[i] == (size_t)(-1)) + { /* Special case for conversion to UTF-8 */ update_content_info(&infos[i], &states[i], bufu, ubl1); + } } if (ibl) + { /* Save unused input */ memmove(bufi, ib, ibl); + } else if (!ubl1 && ib < bufi + sizeof(bufi)) { ret = 0; diff --git a/smtp.c b/smtp.c index e15a26aa0..fb5648e32 100644 --- a/smtp.c +++ b/smtp.c @@ -708,7 +708,9 @@ int mutt_smtp_send(const struct Address *from, const struct Address *to, /* send the recipient list */ if ((rc = smtp_rcpt_to(conn, to)) || (rc = smtp_rcpt_to(conn, cc)) || (rc = smtp_rcpt_to(conn, bcc))) + { break; + } /* send the message data */ rc = smtp_data(conn, msgfile); -- 2.40.0