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:
parent
4bb37cd3af
commit
71866e627e
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user