From: Richard Russon Date: Sat, 21 Sep 2019 15:49:46 +0000 (+0100) Subject: fix cppcheck warnings X-Git-Tag: 2019-10-25~37^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=550d7576ab7de84bff84383de85c2a64f04f5434;p=neomutt fix cppcheck warnings --- diff --git a/browser.c b/browser.c index 7301136f7..012eb8be9 100644 --- a/browser.c +++ b/browser.c @@ -1507,8 +1507,7 @@ void mutt_buffer_select_file(struct Buffer *file, SelectFileFlags flags, browser_highlight_default(&state, menu); init_menu(&state, menu, title, sizeof(title), mailbox); - if (goto_swapper[0] != '\0') - goto_swapper[0] = '\0'; + goto_swapper[0] = '\0'; break; } } @@ -2172,8 +2171,7 @@ bail: mutt_menu_free(&menu); } - if (goto_swapper[0] != '\0') - goto_swapper[0] = '\0'; + goto_swapper[0] = '\0'; } /** diff --git a/config/slist.c b/config/slist.c index bbaed753d..c88b65a30 100644 --- a/config/slist.c +++ b/config/slist.c @@ -108,7 +108,7 @@ static int slist_string_set(const struct ConfigSet *cs, void *var, struct Config cdef->initial = IP mutt_str_strdup(value); } - return CSR_SUCCESS; + return rc; } /** diff --git a/conn/conn_raw.c b/conn/conn_raw.c index 22cded440..8f2819033 100644 --- a/conn/conn_raw.c +++ b/conn/conn_raw.c @@ -326,7 +326,6 @@ int raw_socket_poll(struct Connection *conn, time_t wait_secs) fd_set rfds; unsigned long wait_millis; struct timeval tv; - size_t pre_t, post_t; if (conn->fd < 0) return -1; @@ -341,9 +340,9 @@ int raw_socket_poll(struct Connection *conn, time_t wait_secs) FD_ZERO(&rfds); FD_SET(conn->fd, &rfds); - pre_t = mutt_date_epoch_ms(); + size_t pre_t = mutt_date_epoch_ms(); const int rc = select(conn->fd + 1, &rfds, NULL, NULL, &tv); - post_t = mutt_date_epoch_ms(); + size_t post_t = mutt_date_epoch_ms(); if ((rc > 0) || ((rc < 0) && (errno != EINTR))) return rc; diff --git a/sendlib.c b/sendlib.c index b32709f4c..1f2ef5f20 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1228,9 +1228,7 @@ static void transform_to_7bit(struct Body *a, FILE *fp_in) { if (a->type == TYPE_MULTIPART) { - if (a->encoding != ENC_7BIT) - a->encoding = ENC_7BIT; - + a->encoding = ENC_7BIT; transform_to_7bit(a->parts, fp_in); } else if (mutt_is_message_type(a->type, a->subtype))