summaryrefslogtreecommitdiff
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
parent043c400f909ee0b4431a6657c5b1550df8ab4c83 (diff)
More "(<blah> *)0" -> NULL, avoiding any stdarg functions.
Feedback millert@ kettenis@
-rw-r--r--libexec/ftpd/ftpd.c4
-rw-r--r--libexec/getty/main.c6
-rw-r--r--libexec/getty/subr.c4
-rw-r--r--libexec/ld.so/dlfcn.c4
-rw-r--r--libexec/talkd/process.c8
-rw-r--r--libexec/talkd/table.c6
-rw-r--r--sbin/fsck_ext2fs/main.c8
-rw-r--r--sbin/fsck_ext2fs/utilities.c6
-rw-r--r--sbin/isakmpd/conf.c4
-rw-r--r--sys/arch/sparc/dev/if_ie.c6
-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
-rw-r--r--usr.sbin/amd/amd/sfs_ops.c4
-rw-r--r--usr.sbin/fdformat/fdformat.c4
-rw-r--r--usr.sbin/lpr/lpc/lpc.c4
-rw-r--r--usr.sbin/npppd/common/slist_test.c4
-rw-r--r--usr.sbin/pppd/chat/chat.c6
-rw-r--r--usr.sbin/rbootd/rbootd.c4
-rw-r--r--usr.sbin/rbootd/rmpproto.c4
-rw-r--r--usr.sbin/repquota/repquota.c4
28 files changed, 81 insertions, 81 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 247061eca75..0da9f709e71 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.212 2015/12/12 20:09:28 mmcc Exp $ */
+/* $OpenBSD: ftpd.c,v 1.213 2016/03/16 15:41:10 krw Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -2140,7 +2140,7 @@ renamefrom(char *name)
if (stat(name, &st) < 0) {
perror_reply(550, name);
- return ((char *)0);
+ return (NULL);
}
reply(350, "File exists, ready for destination name");
return (name);
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index bcc455ab888..05b1189c4a0 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.41 2015/11/16 18:37:30 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.42 2016/03/16 15:41:10 krw Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -306,14 +306,14 @@ main(int argc, char *argv[])
exit(1);
}
signal(SIGINT, SIG_DFL);
- for (i = 0; environ[i] != (char *)0; i++)
+ for (i = 0; environ[i] != NULL; i++)
env[i] = environ[i];
makeenv(&env[i]);
limit.rlim_max = RLIM_INFINITY;
limit.rlim_cur = RLIM_INFINITY;
(void)setrlimit(RLIMIT_CPU, &limit);
- execle(LO, "login", "-p", "--", name, (char *)0, env);
+ execle(LO, "login", "-p", "--", name, NULL, env);
syslog(LOG_ERR, "%s: %m", LO);
exit(1);
}
diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c
index 08785c521c6..12b782c3c51 100644
--- a/libexec/getty/subr.c
+++ b/libexec/getty/subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr.c,v 1.25 2015/12/22 08:54:16 mmcc Exp $ */
+/* $OpenBSD: subr.c,v 1.26 2016/03/16 15:41:10 krw Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -413,7 +413,7 @@ makeenv(char *env[])
if (*p)
*ep++ = p;
}
- *ep = (char *)0;
+ *ep = NULL;
}
/*
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c
index 3da0e824f79..620e58517ef 100644
--- a/libexec/ld.so/dlfcn.c
+++ b/libexec/ld.so/dlfcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn.c,v 1.92 2015/12/22 08:54:16 mmcc Exp $ */
+/* $OpenBSD: dlfcn.c,v 1.93 2016/03/16 15:41:10 krw Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -599,7 +599,7 @@ dladdr(const void *addr, Dl_info *info)
info->dli_fname = (char *)object->load_name;
info->dli_fbase = (void *)object->load_base;
info->dli_sname = NULL;
- info->dli_saddr = (void *)0;
+ info->dli_saddr = NULL;
/*
* Walk the symbol list looking for the symbol whose address is
diff --git a/libexec/talkd/process.c b/libexec/talkd/process.c
index f53d485bb02..6bf61e39e27 100644
--- a/libexec/talkd/process.c
+++ b/libexec/talkd/process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.c,v 1.22 2016/02/01 07:25:51 mestre Exp $ */
+/* $OpenBSD: process.c,v 1.23 2016/03/16 15:41:10 krw Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -112,7 +112,7 @@ process_request(CTL_MSG *mp, CTL_RESPONSE *rp)
case LEAVE_INVITE:
ptr = find_request(mp);
- if (ptr != (CTL_MSG *)0) {
+ if (ptr != NULL) {
rp->id_num = htonl(ptr->id_num);
rp->answer = SUCCESS;
} else
@@ -121,7 +121,7 @@ process_request(CTL_MSG *mp, CTL_RESPONSE *rp)
case LOOK_UP:
ptr = find_match(mp);
- if (ptr != (CTL_MSG *)0) {
+ if (ptr != NULL) {
rp->id_num = htonl(ptr->id_num);
rp->addr = ptr->addr;
rp->addr.sa_family = ptr->addr.sa_family;
@@ -157,7 +157,7 @@ do_announce(CTL_MSG *mp, CTL_RESPONSE *rp)
}
hp = gethostbyaddr((char *)&satosin(&mp->ctl_addr)->sin_addr,
sizeof(struct in_addr), AF_INET);
- if (hp == (struct hostent *)0) {
+ if (hp == NULL) {
rp->answer = MACHINE_UNKNOWN;
return;
}
diff --git a/libexec/talkd/table.c b/libexec/talkd/table.c
index b341ba2908b..1cf4d05da6c 100644
--- a/libexec/talkd/table.c
+++ b/libexec/talkd/table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table.c,v 1.17 2016/02/01 07:25:51 mestre Exp $ */
+/* $OpenBSD: table.c,v 1.18 2016/03/16 15:41:10 krw Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -107,7 +107,7 @@ find_match(CTL_MSG *request)
if (debug)
syslog(LOG_DEBUG, "find_match: not found");
- return ((CTL_MSG *)0);
+ return (NULL);
}
/*
@@ -149,7 +149,7 @@ find_request(CTL_MSG *request)
return (&ptr->request);
}
}
- return ((CTL_MSG *)0);
+ return (NULL);
}
void
diff --git a/sbin/fsck_ext2fs/main.c b/sbin/fsck_ext2fs/main.c
index 98bd95f0ddd..d40d5a351e5 100644
--- a/sbin/fsck_ext2fs/main.c
+++ b/sbin/fsck_ext2fs/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.26 2015/11/25 00:29:15 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.27 2016/03/16 15:41:10 krw Exp $ */
/* $NetBSD: main.c,v 1.1 1997/06/11 11:21:50 bouyer Exp $ */
/*
@@ -248,9 +248,9 @@ checkfilesys(char *filesys, char *mntpt, long auxdata, int child)
printf("\n");
}
}
- zlnhead = (struct zlncnt *)0;
- duplist = (struct dups *)0;
- muldup = (struct dups *)0;
+ zlnhead = NULL;
+ duplist = NULL;
+ muldup = NULL;
inocleanup();
if (fsmodified) {
time_t t;
diff --git a/sbin/fsck_ext2fs/utilities.c b/sbin/fsck_ext2fs/utilities.c
index 87243c42d07..ee2d01d9571 100644
--- a/sbin/fsck_ext2fs/utilities.c
+++ b/sbin/fsck_ext2fs/utilities.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utilities.c,v 1.26 2015/09/05 20:07:11 guenther Exp $ */
+/* $OpenBSD: utilities.c,v 1.27 2016/03/16 15:41:10 krw Exp $ */
/* $NetBSD: utilities.c,v 1.6 2001/02/04 21:19:34 christos Exp $ */
/*
@@ -121,7 +121,7 @@ bufinit(void)
char *bufp;
diskreads = totalreads = 0;
- pbp = pdirbp = (struct bufarea *)0;
+ pbp = pdirbp = NULL;
bufhead.b_next = bufhead.b_prev = &bufhead;
bufcnt = MAXBUFSPACE / sblock.e2fs_bsize;
if (bufcnt < MINBUFS)
@@ -256,7 +256,7 @@ ckfini(int markclean)
}
if (bufhead.b_size != cnt)
errexit("Panic: lost %d buffers\n", bufhead.b_size - cnt);
- pbp = pdirbp = (struct bufarea *)0;
+ pbp = pdirbp = NULL;
if (markclean && (sblock.e2fs.e2fs_state & E2FS_ISCLEAN) == 0) {
/*
* Mark the file system as clean, and sync the superblock.
diff --git a/sbin/isakmpd/conf.c b/sbin/isakmpd/conf.c
index 939db83036d..47fe33a2679 100644
--- a/sbin/isakmpd/conf.c
+++ b/sbin/isakmpd/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.105 2015/12/09 21:41:50 naddy Exp $ */
+/* $OpenBSD: conf.c,v 1.106 2016/03/16 15:41:10 krw Exp $ */
/* $EOM: conf.c,v 1.48 2000/12/04 02:04:29 angelos Exp $ */
/*
@@ -975,7 +975,7 @@ conf_report(void)
{
struct conf_binding *cb, *last = 0;
unsigned int i;
- char *current_section = (char *)0;
+ char *current_section = NULL;
struct dumper *dumper, *dnode;
dumper = dnode = calloc(1, sizeof *dumper);
diff --git a/sys/arch/sparc/dev/if_ie.c b/sys/arch/sparc/dev/if_ie.c
index 406b1b696d6..3dd9b9d18f7 100644
--- a/sys/arch/sparc/dev/if_ie.c
+++ b/sys/arch/sparc/dev/if_ie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie.c,v 1.61 2015/12/08 13:34:22 tedu Exp $ */
+/* $OpenBSD: if_ie.c,v 1.62 2016/03/16 15:41:10 krw Exp $ */
/* $NetBSD: if_ie.c,v 1.33 1997/07/29 17:55:38 fair Exp $ */
/*-
@@ -1906,7 +1906,7 @@ mc_reset(sc)
if (ac->ac_multirangecnt > 0) {
ac->ac_if.if_flags |= IFF_ALLMULTI;
- ieioctl(&ac->ac_if, SIOCSIFFLAGS, (void *)0);
+ ieioctl(&ac->ac_if, SIOCSIFFLAGS, NULL);
goto setflag;
}
@@ -1918,7 +1918,7 @@ mc_reset(sc)
while (enm) {
if (sc->mcast_count >= MAXMCAST) {
ac->ac_if.if_flags |= IFF_ALLMULTI;
- ieioctl(&ac->ac_if, SIOCSIFFLAGS, (void *)0);
+ ieioctl(&ac->ac_if, SIOCSIFFLAGS, NULL);
goto setflag;
}
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);
diff --git a/usr.sbin/amd/amd/sfs_ops.c b/usr.sbin/amd/amd/sfs_ops.c
index eed719344a3..9f14e4f7d9b 100644
--- a/usr.sbin/amd/amd/sfs_ops.c
+++ b/usr.sbin/amd/amd/sfs_ops.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)sfs_ops.c 8.1 (Berkeley) 6/6/93
- * $Id: sfs_ops.c,v 1.5 2015/12/05 21:15:01 mmcc Exp $
+ * $Id: sfs_ops.c,v 1.6 2016/03/16 15:41:11 krw Exp $
*/
#include "am.h"
@@ -84,7 +84,7 @@ sfs_match(am_opts *fo)
if (*link == '/')
fullpath = strdup(link);
else
- fullpath = str3cat((char *)0, fo->opt_fs, "/", link);
+ fullpath = str3cat(NULL, fo->opt_fs, "/", link);
} else {
fullpath = strdup(fo->opt_fs);
}
diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c
index a60043fe5cc..c2566992e3a 100644
--- a/usr.sbin/fdformat/fdformat.c
+++ b/usr.sbin/fdformat/fdformat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fdformat.c,v 1.21 2015/12/19 20:38:35 mmcc Exp $ */
+/* $OpenBSD: fdformat.c,v 1.22 2016/03/16 15:41:11 krw Exp $ */
/*
* Copyright (C) 1992-1994 by Joerg Wunsch, Dresden
@@ -224,7 +224,7 @@ main(int argc, char *argv[])
break;
case 'F': /* fill byte, C-like notation allowed */
- fill = (int)strtol(optarg, (char **)0, 0);
+ fill = (int)strtol(optarg, NULL, 0);
break;
case 't': /* steps per track */
diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c
index 2661119f60d..db512d533f9 100644
--- a/usr.sbin/lpr/lpc/lpc.c
+++ b/usr.sbin/lpr/lpc/lpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpc.c,v 1.19 2015/01/16 06:40:18 deraadt Exp $ */
+/* $OpenBSD: lpc.c,v 1.20 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: lpc.c,v 1.11 2001/11/14 03:01:15 enami Exp $ */
/*
@@ -262,7 +262,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\t%s\n", HELPINDENT,
diff --git a/usr.sbin/npppd/common/slist_test.c b/usr.sbin/npppd/common/slist_test.c
index 9ec3dbd20c9..9c5e2efa108 100644
--- a/usr.sbin/npppd/common/slist_test.c
+++ b/usr.sbin/npppd/common/slist_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slist_test.c,v 1.5 2015/12/17 08:01:55 tb Exp $ */
+/* $OpenBSD: slist_test.c,v 1.6 2016/03/16 15:41:11 krw Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* All rights reserved.
@@ -323,7 +323,7 @@ test_05()
for (i = 0; i < 254; i++) {
slist_remove_first(&sl);
}
- slist_set(l, 0, (void *)0);
+ slist_set(l, 0, NULL);
/* Add 7 items */
for (i = 0; i < 8; i++) {
slist_add(&sl, (void *)i + 1);
diff --git a/usr.sbin/pppd/chat/chat.c b/usr.sbin/pppd/chat/chat.c
index 2be9219bd7b..8092c485f69 100644
--- a/usr.sbin/pppd/chat/chat.c
+++ b/usr.sbin/pppd/chat/chat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chat.c,v 1.33 2016/01/25 21:24:17 gsoares Exp $ */
+/* $OpenBSD: chat.c,v 1.34 2016/03/16 15:41:11 krw Exp $ */
/*
* Chat -- a program for automatic session establishment (i.e. dial
@@ -160,7 +160,7 @@ struct termio saved_tty_parameters;
struct termios saved_tty_parameters;
#endif
-char *abort_string[MAX_ABORTS], *fail_reason = (char *)0,
+char *abort_string[MAX_ABORTS], *fail_reason = NULL,
fail_buffer[50];
int n_aborts = 0, abort_next = 0, timeout_next = 0, echo_next = 0;
int clear_abort_next = 0;
@@ -1286,7 +1286,7 @@ register char *string;
register char *s = temp, *end = s + STR_LEN;
char *logged = temp;
- fail_reason = (char *)0;
+ fail_reason = NULL;
string = clean(string, 0);
len = strlen(string);
minlen = (len > sizeof(fail_buffer)? len: sizeof(fail_buffer)) - 1;
diff --git a/usr.sbin/rbootd/rbootd.c b/usr.sbin/rbootd/rbootd.c
index bcf94b469f4..1c7d1d78aa1 100644
--- a/usr.sbin/rbootd/rbootd.c
+++ b/usr.sbin/rbootd/rbootd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rbootd.c,v 1.29 2016/01/25 21:31:38 gsoares Exp $ */
+/* $OpenBSD: rbootd.c,v 1.30 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: rbootd.c,v 1.5 1995/10/06 05:12:17 thorpej Exp $ */
/*
@@ -289,7 +289,7 @@ DoTimeout(void)
RMPCONN *rtmp;
struct timeval now;
- (void) gettimeofday(&now, (struct timezone *)0);
+ (void) gettimeofday(&now, NULL);
/*
* For each active connection, if RMP_TIMEOUT seconds have passed
diff --git a/usr.sbin/rbootd/rmpproto.c b/usr.sbin/rbootd/rmpproto.c
index 2831eaad74e..74d8277b9b6 100644
--- a/usr.sbin/rbootd/rmpproto.c
+++ b/usr.sbin/rbootd/rmpproto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmpproto.c,v 1.11 2015/01/16 06:40:19 deraadt Exp $ */
+/* $OpenBSD: rmpproto.c,v 1.12 2016/03/16 15:41:11 krw Exp $ */
/* $NetBSD: rmpproto.c,v 1.5.2.1 1995/11/14 08:45:44 thorpej Exp $ */
/*
@@ -570,7 +570,7 @@ SendPacket(RMPCONN *rconn)
/*
* Last time this connection was active.
*/
- (void) gettimeofday(&rconn->tstamp, (struct timezone *)0);
+ (void) gettimeofday(&rconn->tstamp, NULL);
if (DbgFp != NULL) /* display packet */
DispPkt(rconn,DIR_SENT);
diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c
index bbde734daaf..f4144821013 100644
--- a/usr.sbin/repquota/repquota.c
+++ b/usr.sbin/repquota/repquota.c
@@ -192,7 +192,7 @@ repquota(struct fstab *fs, int type, char *qfpathname)
if (dqbuf.dqb_curinodes == 0 && dqbuf.dqb_curblocks == 0)
continue;
if ((fup = lookup(id, type)) == 0)
- fup = addid(id, type, (char *)0);
+ fup = addid(id, type, NULL);
fup->fu_dqblk = dqbuf;
}
fclose(qf);
@@ -302,7 +302,7 @@ lookup(uid_t id, int type)
for (fup = fuhead[type][id & (FUHASH-1)]; fup != 0; fup = fup->fu_next)
if (fup->fu_id == id)
return (fup);
- return ((struct fileusage *)0);
+ return (NULL);
}
/*