summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-03-16 15:41:12 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-03-16 15:41:12 +0000
commitd8ebeb5c1882685478f7aff85d3cfd52cb45385b (patch)
tree6a871a498e943d359bc98a18b415e916ac0ef2b6 /usr.bin
parent043c400f909ee0b4431a6657c5b1550df8ab4c83 (diff)
More "(<blah> *)0" -> NULL, avoiding any stdarg functions.
Feedback millert@ kettenis@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/deroff/deroff.c4
-rw-r--r--usr.bin/ftp/ftp.c4
-rw-r--r--usr.bin/ftp/main.c6
-rw-r--r--usr.bin/ftp/util.c8
-rw-r--r--usr.bin/quota/quota.c20
-rw-r--r--usr.bin/showmount/showmount.c14
-rw-r--r--usr.bin/talk/invite.c4
-rw-r--r--usr.bin/telnet/commands.c4
-rw-r--r--usr.bin/telnet/sys_bsd.c4
-rw-r--r--usr.bin/tftp/main.c4
10 files changed, 36 insertions, 36 deletions
diff --git a/usr.bin/deroff/deroff.c b/usr.bin/deroff/deroff.c
index 0957ec1661e..170d4937f11 100644
--- a/usr.bin/deroff/deroff.c
+++ b/usr.bin/deroff/deroff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: deroff.c,v 1.13 2015/10/09 01:37:07 deraadt Exp $ */
+/* $OpenBSD: deroff.c,v 1.14 2016/03/16 15:41:10 krw Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -1425,7 +1425,7 @@ comline(void)
int lb, ub;
int hit;
static int tabsize = 0;
- static struct mactab *mactab = (struct mactab *)0;
+ static struct mactab *mactab = NULL;
struct mactab *mp;
if (mactab == 0)
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 316de221154..b4c17c2692e 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.95 2015/12/05 22:28:40 krw Exp $ */
+/* $OpenBSD: ftp.c,v 1.96 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */
/*
@@ -304,7 +304,7 @@ hookup(char *host, char *port)
return (hostname);
bad:
(void)close(s);
- return ((char *)0);
+ return (NULL);
}
/* ARGSUSED */
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index fd7b1a1d227..06ad4563251 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.105 2015/11/04 17:54:06 jca Exp $ */
+/* $OpenBSD: main.c,v 1.106 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -852,7 +852,7 @@ OUT:
default:
break;
}
- return ((char *)0);
+ return (NULL);
}
/*
@@ -887,7 +887,7 @@ help(int argc, char *argv[])
c = getcmd(arg);
if (c == (struct cmd *)-1)
fprintf(ttyout, "?Ambiguous help command %s\n", arg);
- else if (c == (struct cmd *)0)
+ else if (c == NULL)
fprintf(ttyout, "?Invalid help command %s\n", arg);
else
fprintf(ttyout, "%-*s\t%s\n", HELPINDENT,
diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c
index fe05ce6ab77..d1e52fa0812 100644
--- a/usr.bin/ftp/util.c
+++ b/usr.bin/ftp/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.76 2015/12/09 17:55:42 mmcc Exp $ */
+/* $OpenBSD: util.c,v 1.77 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */
/*-
@@ -764,11 +764,11 @@ progressmeter(int flag, const char *filename)
char buf[512];
if (flag == -1) {
- (void)gettimeofday(&start, (struct timezone *)0);
+ (void)gettimeofday(&start, NULL);
lastupdate = start;
lastsize = restart_point;
}
- (void)gettimeofday(&now, (struct timezone *)0);
+ (void)gettimeofday(&now, NULL);
if (!progress || filesize < 0)
return;
cursize = bytes + restart_point;
@@ -925,7 +925,7 @@ ptransfer(int siginfo)
if (!verbose && !siginfo)
return;
- (void)gettimeofday(&now, (struct timezone *)0);
+ (void)gettimeofday(&now, NULL);
timersub(&now, &start, &td);
elapsed = td.tv_sec + (td.tv_usec / 1000000.0);
bs = bytes / (elapsed == 0.0 ? 1 : elapsed);
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index 1980c0d9965..e75b1541c54 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quota.c,v 1.37 2015/12/09 19:39:10 mmcc Exp $ */
+/* $OpenBSD: quota.c,v 1.38 2016/03/16 15:41:11 krw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -305,7 +305,7 @@ showquotas(int type, u_long id, const char *name)
qup->dqblk.dqb_bsoftlimit == 0 &&
qup->dqblk.dqb_bhardlimit == 0)
continue;
- msgi = (char *)0;
+ msgi = NULL;
if (qup->dqblk.dqb_ihardlimit &&
qup->dqblk.dqb_curinodes >= qup->dqblk.dqb_ihardlimit)
msgi = "File limit reached on";
@@ -316,7 +316,7 @@ showquotas(int type, u_long id, const char *name)
else
msgi = "Over file quota on";
}
- msgb = (char *)0;
+ msgb = NULL;
if (qup->dqblk.dqb_bhardlimit &&
qup->dqblk.dqb_curblocks >= qup->dqblk.dqb_bhardlimit)
msgb = "Block limit reached on";
@@ -328,12 +328,12 @@ showquotas(int type, u_long id, const char *name)
msgb = "Over block quota on";
}
if (qflag) {
- if ((msgi != (char *)0 || msgb != (char *)0) &&
+ if ((msgi != NULL || msgb != NULL) &&
lines++ == 0)
heading(type, id, name, "");
- if (msgi != (char *)0)
+ if (msgi != NULL)
printf("\t%s %s\n", msgi, qup->fsname);
- if (msgb != (char *)0)
+ if (msgb != NULL)
printf("\t%s %s\n", msgb, qup->fsname);
continue;
}
@@ -351,19 +351,19 @@ showquotas(int type, u_long id, const char *name)
nam,
(int)(dbtob((u_quad_t)qup->dqblk.dqb_curblocks)
/ 1024),
- (msgb == (char *)0) ? ' ' : '*',
+ (msgb == NULL) ? ' ' : '*',
(int)(dbtob((u_quad_t)qup->dqblk.dqb_bsoftlimit)
/ 1024),
(int)(dbtob((u_quad_t)qup->dqblk.dqb_bhardlimit)
/ 1024),
- (msgb == (char *)0) ? ""
+ (msgb == NULL) ? ""
: timeprt(qup->dqblk.dqb_btime));
printf(" %7d%c %7d %7d %7s\n",
qup->dqblk.dqb_curinodes,
- (msgi == (char *)0) ? ' ' : '*',
+ (msgi == NULL) ? ' ' : '*',
qup->dqblk.dqb_isoftlimit,
qup->dqblk.dqb_ihardlimit,
- (msgi == (char *)0) ? ""
+ (msgi == NULL) ? ""
: timeprt(qup->dqblk.dqb_itime)
);
continue;
diff --git a/usr.bin/showmount/showmount.c b/usr.bin/showmount/showmount.c
index c2ddf6a8189..1c5ff28c5bb 100644
--- a/usr.bin/showmount/showmount.c
+++ b/usr.bin/showmount/showmount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: showmount.c,v 1.19 2015/11/17 15:01:28 deraadt Exp $ */
+/* $OpenBSD: showmount.c,v 1.20 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: showmount.c,v 1.7 1996/05/01 18:14:10 cgd Exp $ */
/*
@@ -167,7 +167,7 @@ main(int argc, char *argv[])
err(1, "pledge");
if (rpcs & DODUMP) {
- estat = clnt_call(client, RPCMNT_DUMP, xdr_void, (char *)0,
+ estat = clnt_call(client, RPCMNT_DUMP, xdr_void, NULL,
xdr_mntdump, (char *)&mntdump, timeout);
if (estat != RPC_SUCCESS) {
fprintf(stderr, "showmount: Can't do Mountdump rpc: ");
@@ -176,7 +176,7 @@ main(int argc, char *argv[])
}
}
if (rpcs & DOEXPORTS) {
- estat = clnt_call(client, RPCMNT_EXPORT, xdr_void, (char *)0,
+ estat = clnt_call(client, RPCMNT_EXPORT, xdr_void, NULL,
xdr_exports, (char *)&exports, timeout);
if (estat != RPC_SUCCESS) {
fprintf(stderr, "showmount: Can't do Exports rpc: ");
@@ -238,14 +238,14 @@ xdr_mntdump(XDR *xdrsp, struct mountlist **mlp)
int bool, val, val2;
char *strp;
- *mlp = (struct mountlist *)0;
+ *mlp = NULL;
if (!xdr_bool(xdrsp, &bool))
return (0);
while (bool) {
mp = malloc(sizeof(struct mountlist));
if (mp == NULL)
return (0);
- mp->ml_left = mp->ml_right = (struct mountlist *)0;
+ mp->ml_left = mp->ml_right = NULL;
strp = mp->ml_host;
if (!xdr_string(xdrsp, &strp, RPCMNT_NAMELEN))
return (0);
@@ -316,14 +316,14 @@ xdr_exports(XDR *xdrsp, struct exportslist **exp)
int bool, grpbool;
char *strp;
- *exp = (struct exportslist *)0;
+ *exp = NULL;
if (!xdr_bool(xdrsp, &bool))
return (0);
while (bool) {
ep = malloc(sizeof(struct exportslist));
if (ep == NULL)
return (0);
- ep->ex_groups = (struct grouplist *)0;
+ ep->ex_groups = NULL;
strp = ep->ex_dirp;
if (!xdr_string(xdrsp, &strp, RPCMNT_PATHLEN))
return (0);
diff --git a/usr.bin/talk/invite.c b/usr.bin/talk/invite.c
index 9f07a7ebbbe..fe023ddf8c1 100644
--- a/usr.bin/talk/invite.c
+++ b/usr.bin/talk/invite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: invite.c,v 1.16 2016/02/01 07:29:25 mestre Exp $ */
+/* $OpenBSD: invite.c,v 1.17 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: invite.c,v 1.3 1994/12/09 02:14:18 jtc Exp $ */
/*
@@ -93,7 +93,7 @@ invite_remote(void)
* gets called again in main().
*/
end_msgs();
- setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0);
+ setitimer(ITIMER_REAL, &itimer, NULL);
message("Waiting for your party to respond");
signal(SIGALRM, re_invite);
(void) setjmp(invitebuf);
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index d289692c802..e82e4c5acf1 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commands.c,v 1.82 2015/12/09 19:39:10 mmcc Exp $ */
+/* $OpenBSD: commands.c,v 1.83 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
@@ -2078,7 +2078,7 @@ help(int argc, char *argv[])
c = getcmd(arg);
if (Ambiguous(c))
printf("?Ambiguous help command %s\r\n", arg);
- else if (c == (Command *)0)
+ else if (c == NULL)
printf("?Invalid help command %s\r\n", arg);
else
printf("%s\r\n", c->help);
diff --git a/usr.bin/telnet/sys_bsd.c b/usr.bin/telnet/sys_bsd.c
index 173fe79ea0f..01ff9173900 100644
--- a/usr.bin/telnet/sys_bsd.c
+++ b/usr.bin/telnet/sys_bsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_bsd.c,v 1.31 2015/11/29 14:18:40 semarie Exp $ */
+/* $OpenBSD: sys_bsd.c,v 1.32 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */
/*
@@ -181,7 +181,7 @@ tcval(int func)
case SLC_BRK:
case SLC_EOR:
default:
- return((cc_t *)0);
+ return(NULL);
}
}
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index e653b8aefcf..28560039fe7 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.39 2015/11/11 01:12:10 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.40 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */
/*
@@ -716,7 +716,7 @@ help(int argc, char *argv[])
c = getcmd(arg);
if (c == (struct cmd *) - 1)
printf("?Ambiguous help command %s\n", arg);
- else if (c == (struct cmd *)0)
+ else if (c == NULL)
printf("?Invalid help command %s\n", arg);
else
printf("%s\n", c->help);