diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-10 21:48:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-10 21:48:25 +0100 |
commit | b7633611611eeb5f14f8fd598afa687964e23f23 (patch) | |
tree | fa9dff5fb75eb6d62d3c3fc9cd9a0c0d05c3b83d /src | |
parent | 18c5632cab09e5e51320f55005f310920648f35b (diff) |
patch 8.1.0886: compiler warning for NULL pointer and condition always truev8.1.0886
Problem: Compiler warning for adding to NULL pointer and a condition that
is always true.
Solution: Check for NULL pointer before adding. Remove useless "if".
(Friedirch, closes #3913)
Diffstat (limited to 'src')
-rw-r--r-- | src/dosinst.c | 9 | ||||
-rw-r--r-- | src/search.c | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 14 insertions, 15 deletions
diff --git a/src/dosinst.c b/src/dosinst.c index 5b05598872..7025eb6184 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -291,16 +291,17 @@ findoldfile(char **destination) { char *bp = *destination; size_t indir_l = strlen(installdir); - char *cp = bp + indir_l; + char *cp; char *tmpname; char *farname; /* * No action needed if exe not found or not in this directory. */ - if (bp == NULL - || strnicmp(bp, installdir, indir_l) != 0 - || strchr("/\\", *cp++) == NULL + if (bp == NULL || strnicmp(bp, installdir, indir_l) != 0) + return; + cp = bp + indir_l; + if (strchr("/\\", *cp++) == NULL || strchr(cp, '\\') != NULL || strchr(cp, '/') != NULL) return; diff --git a/src/search.c b/src/search.c index 4b3f8532a5..df7067b08f 100644 --- a/src/search.c +++ b/src/search.c @@ -4732,18 +4732,14 @@ current_search( VIsual_active = TRUE; VIsual_mode = 'v'; - if (VIsual_active) + redraw_curbuf_later(INVERTED); /* update the inversion */ + if (*p_sel == 'e') { - redraw_curbuf_later(INVERTED); /* update the inversion */ - if (*p_sel == 'e') - { - /* Correction for exclusive selection depends on the direction. */ - if (forward && LTOREQ_POS(VIsual, curwin->w_cursor)) - inc_cursor(); - else if (!forward && LTOREQ_POS(curwin->w_cursor, VIsual)) - inc(&VIsual); - } - + /* Correction for exclusive selection depends on the direction. */ + if (forward && LTOREQ_POS(VIsual, curwin->w_cursor)) + inc_cursor(); + else if (!forward && LTOREQ_POS(curwin->w_cursor, VIsual)) + inc(&VIsual); } #ifdef FEAT_FOLDING diff --git a/src/version.c b/src/version.c index 641d8020ca..aa17e0afa3 100644 --- a/src/version.c +++ b/src/version.c @@ -784,6 +784,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 886, +/**/ 885, /**/ 884, |