Use NULL instead of 0 for pointers.
strchr(3) will return NULL if the character does not appear in the string. MFC after: 2 weeks.
This commit is contained in:
parent
c0e5e7f3d2
commit
edf6b683e8
@ -1331,7 +1331,7 @@ getdev(const char *name)
|
||||
return (name);
|
||||
|
||||
cp = strrchr(name, '/');
|
||||
if (cp == 0) {
|
||||
if (cp == NULL) {
|
||||
snprintf(device, sizeof(device), "%s%s", _PATH_DEV, name);
|
||||
if (is_dev(device))
|
||||
return (device);
|
||||
|
@ -306,7 +306,7 @@ main(int argc, char *argv[])
|
||||
if (!special[0])
|
||||
err(1, "empty file/special name");
|
||||
cp = strrchr(special, '/');
|
||||
if (cp == 0) {
|
||||
if (cp == NULL) {
|
||||
/*
|
||||
* No path prefix; try prefixing _PATH_DEV.
|
||||
*/
|
||||
|
@ -62,7 +62,7 @@ pathcheck(char *name)
|
||||
char *start;
|
||||
|
||||
start = strchr(name, '/');
|
||||
if (start == 0)
|
||||
if (start == NULL)
|
||||
return;
|
||||
for (cp = start; *cp != '\0'; cp++) {
|
||||
if (*cp != '/')
|
||||
|
Loading…
Reference in New Issue
Block a user