From 5b47ee5b7a48445f0a12a4e5316d44ec70e64d7f Mon Sep 17 00:00:00 2001 From: Ihor Antonov Date: Sat, 27 Jul 2019 23:16:14 -0400 Subject: [PATCH] pvs/V560: part of conditional expression is always true (#10629) Since timed_out is pointer to int condition timed_out != NULL && timed_out makes no sense as both are effectively the same thing. Most likely the first check was meant to guard the dereference of the second. Wrong import of Vim patch (8.0.0643). --- src/nvim/search.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/nvim/search.c b/src/nvim/search.c index c1770fd80d..9cda76d324 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -864,13 +864,11 @@ int searchit( } at_first_line = FALSE; - /* - * Stop the search if wrapscan isn't set, "stop_lnum" is - * specified, after an interrupt, after a match and after looping - * twice. - */ + // Stop the search if wrapscan isn't set, "stop_lnum" is + // specified, after an interrupt, after a match and after looping + // twice. if (!p_ws || stop_lnum != 0 || got_int || called_emsg - || (timed_out != NULL && timed_out) + || (timed_out != NULL && *timed_out) || break_loop || found || loop) { break;