mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
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:
parent
ef1cb629d8
commit
7dbab9554d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298183
|
@ -451,7 +451,7 @@ generate_guard(const char *pathname)
|
|||
char *guard, *tmp, *stopat;
|
||||
|
||||
filename = strrchr(pathname, '/'); /* find last component */
|
||||
filename = ((filename == 0) ? pathname : filename+1);
|
||||
filename = ((filename == NULL) ? pathname : filename+1);
|
||||
guard = xstrdup(filename);
|
||||
stopat = strrchr(guard, '.');
|
||||
|
||||
|
|
Loading…
Reference in a new issue