diff options
author | yar <yar@FreeBSD.org> | 2004-07-31 15:03:17 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2004-07-31 15:03:17 +0000 |
commit | d786b94f15a1fcab85df6a7b07d4911dfc2a44db (patch) | |
tree | 3b6b6c4f1ccd06097dda89df4ca3e1306e7624ee | |
parent | 06b7ed859fcdd8e379c1a413d95f865b62f16e31 (diff) | |
download | FreeBSD-src-d786b94f15a1fcab85df6a7b07d4911dfc2a44db.zip FreeBSD-src-d786b94f15a1fcab85df6a7b07d4911dfc2a44db.tar.gz |
Change ``(foo *)0'' to ``NULL'' where it's possible
(and it appears possible throughout ftpd(8) source.)
It is not a mere issue of style: Null pointers in C
seem to have been mistaken one way or another quite often.
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 20 | ||||
-rw-r--r-- | libexec/ftpd/ftpd.c | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 2dc49d0..e664914 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -106,7 +106,7 @@ static int cmd_form; static int cmd_bytesz; static int state; char cbuf[512]; -char *fromname = (char *) 0; +char *fromname = NULL; extern int epsvall; @@ -159,7 +159,7 @@ cmd_list { if (fromname) free(fromname); - fromname = (char *) 0; + fromname = NULL; restart_point = 0; } | cmd_list rcmd @@ -455,7 +455,7 @@ cmd if (noretr || (guest && noguestretr)) reply(500, "RETR command is disabled"); else if ($2 && $4 != NULL) - retrieve((char *) 0, $4); + retrieve(NULL, $4); if ($4 != NULL) free($4); @@ -522,7 +522,7 @@ cmd if (fromname) { renamecmd(fromname, $4); free(fromname); - fromname = (char *) 0; + fromname = NULL; } else { reply(503, "Bad sequence of commands."); } @@ -550,7 +550,7 @@ cmd } | HELP CRLF { - help(cmdtab, (char *) 0); + help(cmdtab, NULL); } | HELP SP STRING CRLF { @@ -563,7 +563,7 @@ cmd if (*cp) help(sitetab, cp); else - help(sitetab, (char *) 0); + help(sitetab, NULL); } else help(cmdtab, $3); free($3); @@ -598,7 +598,7 @@ cmd } | SITE SP HELP CRLF { - help(sitetab, (char *) 0); + help(sitetab, NULL); } | SITE SP HELP SP STRING CRLF { @@ -771,7 +771,7 @@ rcmd if ($2 && $4) { if (fromname) free(fromname); - fromname = (char *) 0; + fromname = NULL; if (renamefrom($4)) fromname = $4; else @@ -785,7 +785,7 @@ rcmd if ($2) { if (fromname) free(fromname); - fromname = (char *) 0; + fromname = NULL; restart_point = $4.o; reply(350, "Restarting at %jd. %s", (intmax_t)restart_point, @@ -1556,7 +1556,7 @@ help(struct tab *ctab, char *s) } upper(s); c = lookup(ctab, s); - if (c == (struct tab *)0) { + if (c == NULL) { reply(502, "Unknown command %s.", s); return; } diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 75c41ac..46b1101 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1910,7 +1910,7 @@ dataconn(char *name, off_t size, char *mode) if ((flags = fcntl(pdata, F_GETFL, 0)) == -1 || fcntl(pdata, F_SETFL, flags | O_NONBLOCK) == -1) goto pdata_err; - if (select(pdata+1, &set, (fd_set *) 0, (fd_set *) 0, &timeout) <= 0 || + if (select(pdata+1, &set, NULL, NULL, &timeout) <= 0 || (s = accept(pdata, (struct sockaddr *) &from, &fromlen)) < 0) goto pdata_err; (void) close(pdata); |