rexec(3): use NULL instead of zero for pointers.
This commit is contained in:
parent
7c5409f82b
commit
163ec53664
@ -187,7 +187,7 @@ ruserpass(host, aname, apass, aacct)
|
||||
|
||||
case LOGIN:
|
||||
if (token())
|
||||
if (*aname == 0) {
|
||||
if (*aname == NULL) {
|
||||
*aname = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*aname, tokval);
|
||||
} else {
|
||||
@ -196,14 +196,14 @@ ruserpass(host, aname, apass, aacct)
|
||||
}
|
||||
break;
|
||||
case PASSWD:
|
||||
if ((*aname == 0 || strcmp(*aname, "anonymous")) &&
|
||||
if ((*aname == NULL || strcmp(*aname, "anonymous")) &&
|
||||
fstat(fileno(cfile), &stb) >= 0 &&
|
||||
(stb.st_mode & 077) != 0) {
|
||||
warnx("Error: .netrc file is readable by others.");
|
||||
warnx("Remove password or make file unreadable by others.");
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *apass == 0) {
|
||||
if (token() && *apass == NULL) {
|
||||
*apass = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*apass, tokval);
|
||||
}
|
||||
@ -215,7 +215,7 @@ ruserpass(host, aname, apass, aacct)
|
||||
warnx("Remove account or make file unreadable by others.");
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *aacct == 0) {
|
||||
if (token() && *aacct == NULL) {
|
||||
*aacct = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*aacct, tokval);
|
||||
}
|
||||
@ -305,7 +305,7 @@ rexec(ahost, rport, name, pass, cmd, fd2p)
|
||||
char c, *acct;
|
||||
|
||||
hp = gethostbyname(*ahost);
|
||||
if (hp == 0) {
|
||||
if (hp == NULL) {
|
||||
herror(*ahost);
|
||||
return (-1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user