mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
clang/'Dead store': do not assign fnamelen
Vim hasn't changed this line in buf_modname(). Assigning a value to fnamelen is useless when evaluating strlen() is sufficient for the condition check.
This commit is contained in:
@@ -4280,7 +4280,7 @@ char *modname(const char *fname, const char *ext, bool prepend_dot)
|
|||||||
if (fname == NULL || *fname == NUL) {
|
if (fname == NULL || *fname == NUL) {
|
||||||
retval = xmalloc(MAXPATHL + extlen + 3); // +3 for PATHSEP, "_" (Win), NUL
|
retval = xmalloc(MAXPATHL + extlen + 3); // +3 for PATHSEP, "_" (Win), NUL
|
||||||
if (os_dirname((char_u *)retval, MAXPATHL) == FAIL
|
if (os_dirname((char_u *)retval, MAXPATHL) == FAIL
|
||||||
|| (fnamelen = strlen(retval)) == 0) {
|
|| strlen(retval) == 0) {
|
||||||
xfree(retval);
|
xfree(retval);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user