Use NULL for pointers.

strrchr(3) will return NULL if the character does not appears in
the string.

MFC after:	2 weeks.
This commit is contained in:
araujo 2016-04-18 06:02:26 +00:00
parent d2d25bb0ca
commit 76c4083741

View File

@ -451,7 +451,7 @@ generate_guard(const char *pathname)
char *guard, *tmp, *stopat; char *guard, *tmp, *stopat;
filename = strrchr(pathname, '/'); /* find last component */ filename = strrchr(pathname, '/'); /* find last component */
filename = ((filename == 0) ? pathname : filename+1); filename = ((filename == NULL) ? pathname : filename+1);
guard = xstrdup(filename); guard = xstrdup(filename);
stopat = strrchr(guard, '.'); stopat = strrchr(guard, '.');