(x_basename): the NULL check is unnecessary...

...because the pointer can't be NULL.

Found by Coverity.
Coverity id #110817.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andreas Mohr 2020-12-21 10:15:10 +00:00 committed by Andrew Borodin
parent a68f2d1202
commit 40b96b67dd

View File

@ -663,7 +663,7 @@ x_basename (const char *s)
{
/* avoid trailing PATH_SEP, if present */
if (!IS_PATH_SEP (s[strlen (s) - 1]))
return (path_sep != NULL) ? path_sep + 1 : s;
return path_sep + 1;
while (--path_sep > s && !IS_PATH_SEP (*path_sep))
;