Fix warnings: regexp.c: skip_regexp: Np dereference: FP.

Problem: Derefence of null pointer @ 1208.
         http://neovim.org/doc/reports/clang/report-24b5ca.html#Path10

Diagnostic: False positive.
Rationale : Error is reported to happen  if after `if (*newp == NULL) {`
            body, `*newp` continues being NULL, and false branch of
            following `if (*newp != NULL)` is taken. Now, `vim_strsave`
            cannot return NULL, so error cannot happen.
Resolution: Remove dead code (leftover since OOM refactors).
This commit is contained in:
Eliseo Martínez 2014-11-04 15:41:46 +01:00
parent 9de544c785
commit 336aab5eef

View File

@ -1199,10 +1199,7 @@ char_u *skip_regexp(char_u *startp, int dirc, int magic, char_u **newp)
*newp = vim_strsave(startp);
p = *newp + (p - startp);
}
if (*newp != NULL)
STRMOVE(p, p + 1);
else
++p;
STRMOVE(p, p + 1);
} else
++p; /* skip next character */
if (*p == 'v')