aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIhor Antonov <ngortheone@users.noreply.github.com>2019-07-27 23:16:14 -0400
committerDaniel Hahler <git@thequod.de>2019-07-28 05:16:14 +0200
commit5b47ee5b7a48445f0a12a4e5316d44ec70e64d7f (patch)
treecc5a7ce7600f170edfb03d72b95b9a188eb2ac03 /src
parent7f5a113f659fc88c2e9566c3dcdc1c8f0beccc5a (diff)
downloadrneovim-5b47ee5b7a48445f0a12a4e5316d44ec70e64d7f.tar.gz
rneovim-5b47ee5b7a48445f0a12a4e5316d44ec70e64d7f.tar.bz2
rneovim-5b47ee5b7a48445f0a12a4e5316d44ec70e64d7f.zip
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).
Diffstat (limited to 'src')
-rw-r--r--src/nvim/search.c10
1 files 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;