mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.1.0886: compiler warning for NULL pointer and condition always true
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)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user