Use NULL instead of 0 for pointers.

getenv(3) returns NULL if the variable name is not in the current
environment.
getservent(3) returns NULL on EOF or error

MFC after:	4 weeks
This commit is contained in:
Marcelo Araujo 2016-04-15 03:50:33 +00:00
parent 4bb37cd3af
commit 71866e627e
2 changed files with 2 additions and 2 deletions

View File

@ -651,7 +651,7 @@ ShellCommand(struct cmdargs const *arg, int bg)
if ((shpid = fork()) == 0) {
int i, fd;
if ((shell = getenv("SHELL")) == 0)
if ((shell = getenv("SHELL")) == NULL)
shell = _PATH_BSHELL;
timer_TermService();

View File

@ -80,7 +80,7 @@ ParsePort(const char *service, const char *proto)
int port;
servent = getservbyname(service, proto);
if (servent != 0)
if (servent != NULL)
return ntohs(servent->s_port);
port = strtol(service, &cp, 0);