end the argument list to exec*(3) with a NULL instead of a bare '0', as

the latter isn't a pointer context in these varargs functions.
This commit is contained in:
mrg 2006-05-11 00:22:52 +00:00
parent 8e969ac070
commit 4bc6feceb6
7 changed files with 26 additions and 26 deletions

View File

@ -1,9 +1,9 @@
/* $NetBSD: tok.c,v 1.5 1997/10/18 20:03:54 christos Exp $ */
/* $NetBSD: tok.c,v 1.6 2006/05/11 00:22:52 mrg Exp $ */
/* tok.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: tok.c,v 1.5 1997/10/18 20:03:54 christos Exp $");
__RCSID("$NetBSD: tok.c,v 1.6 2006/05/11 00:22:52 mrg Exp $");
#endif /* not lint */
#include <sys/types.h>
@ -98,7 +98,7 @@ yylex()
clear();/* scrolling region, home, clear, no
* attributes */
if ((ic = fork()) == 0) { /* child */
execl("/bin/csh", 0);
execl("/bin/csh", "/bin/csh", NULL);
exit(1);
}
wait(0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rexecd.c,v 1.23 2005/04/19 03:22:54 christos Exp $ */
/* $NetBSD: rexecd.c,v 1.24 2006/05/11 00:22:52 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "from: @(#)rexecd.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: rexecd.c,v 1.23 2005/04/19 03:22:54 christos Exp $");
__RCSID("$NetBSD: rexecd.c,v 1.24 2006/05/11 00:22:52 mrg Exp $");
#endif
#endif /* not lint */
@ -368,7 +368,7 @@ doit(struct sockaddr *fromp)
cp = pwd->pw_shell;
if (dolog)
syslog(LOG_INFO, "running command for %s: %s", user, cmdbuf);
(void)execl(pwd->pw_shell, cp, "-c", cmdbuf, 0);
(void)execl(pwd->pw_shell, cp, "-c", cmdbuf, NULL);
if (dolog)
syslog(LOG_ERR, "execl failed for %s: %m", user);
err(EXIT_FAILURE, "%s", pwd->pw_shell);

View File

@ -1,4 +1,4 @@
/* $NetBSD: server.c,v 1.28 2004/08/06 15:50:02 mycroft Exp $ */
/* $NetBSD: server.c,v 1.29 2006/05/11 00:22:52 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)server.c 8.1 (Berkeley) 6/9/93";
#else
__RCSID("$NetBSD: server.c,v 1.28 2004/08/06 15:50:02 mycroft Exp $");
__RCSID("$NetBSD: server.c,v 1.29 2006/05/11 00:22:52 mrg Exp $");
#endif
#endif /* not lint */
@ -1388,7 +1388,7 @@ dospecial(char *cmd)
(void) close(fd[1]);
setgid(groupid);
setuid(userid);
execl(_PATH_BSHELL, "sh", "-c", cmd, 0);
execl(_PATH_BSHELL, "sh", "-c", cmd, NULL);
_exit(127);
}
(void) close(fd[1]);

View File

@ -1,4 +1,4 @@
/* $NetBSD: commands.c,v 1.65 2006/05/05 00:03:22 rpaulo Exp $ */
/* $NetBSD: commands.c,v 1.66 2006/05/11 00:25:46 mrg Exp $ */
/*
* Copyright (C) 1997 and 1998 WIDE Project.
@ -63,7 +63,7 @@
#if 0
static char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95";
#else
__RCSID("$NetBSD: commands.c,v 1.65 2006/05/05 00:03:22 rpaulo Exp $");
__RCSID("$NetBSD: commands.c,v 1.66 2006/05/11 00:25:46 mrg Exp $");
#endif
#endif /* not lint */
@ -1388,9 +1388,9 @@ shell(int argc, char *argv[])
else
shellname++;
if (argc > 1)
execl(shellp, shellname, "-c", &saveline[1], 0);
execl(shellp, shellname, "-c", &saveline[1], NULL);
else
execl(shellp, shellname, 0);
execl(shellp, shellname, NULL);
perror("execl");
_exit(1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmds.c,v 1.28 2006/04/03 16:13:34 tls Exp $ */
/* $NetBSD: cmds.c,v 1.29 2006/05/11 00:22:53 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: cmds.c,v 1.28 2006/04/03 16:13:34 tls Exp $");
__RCSID("$NetBSD: cmds.c,v 1.29 2006/05/11 00:22:53 mrg Exp $");
#endif /* not lint */
#include "tip.h"
@ -586,7 +586,7 @@ shell(char dummy)
cp = value(SHELL);
else
cp++;
execl(value(SHELL), cp, 0);
execl(value(SHELL), cp, NULL);
fprintf(stderr, "\r\n");
err(1, "can't execl");
/* NOTREACHED */
@ -687,7 +687,7 @@ execute(char *s)
cp = value(SHELL);
else
cp++;
execl(value(SHELL), cp, "-c", s, 0);
execl(value(SHELL), cp, "-c", s, NULL);
}
int
@ -875,7 +875,7 @@ expand(char name[])
dup(pivec[1]);
close(pivec[1]);
close(2);
execl(Shell, Shell, "-c", cmdbuf, 0);
execl(Shell, Shell, "-c", cmdbuf, NULL);
_exit(1);
}
if (mypid == -1) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: system.c,v 1.18 2006/04/30 23:43:31 christos Exp $ */
/* $NetBSD: system.c,v 1.19 2006/05/11 00:25:46 mrg Exp $ */
/*-
* Copyright (c) 1988 The Regents of the University of California.
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)system.c 4.5 (Berkeley) 4/26/91";
#else
__RCSID("$NetBSD: system.c,v 1.18 2006/04/30 23:43:31 christos Exp $");
__RCSID("$NetBSD: system.c,v 1.19 2006/05/11 00:25:46 mrg Exp $");
#endif
#endif /* not lint */
@ -748,7 +748,7 @@ char *argv[];
char *cmdname;
cmdname = getenv("SHELL");
execlp(cmdname, cmdname, 0);
execlp(cmdname, cmdname, NULL);
perror("Exec'ing new shell");
_exit(1);
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: printjob.c,v 1.49 2006/03/17 17:06:30 christos Exp $ */
/* $NetBSD: printjob.c,v 1.50 2006/05/11 00:22:53 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)printjob.c 8.7 (Berkeley) 5/10/95";
#else
__RCSID("$NetBSD: printjob.c,v 1.49 2006/03/17 17:06:30 christos Exp $");
__RCSID("$NetBSD: printjob.c,v 1.50 2006/05/11 00:22:53 mrg Exp $");
#endif
#endif /* not lint */
@ -581,7 +581,7 @@ print(int format, char *file)
for (n = 3; n < nofile; n++)
(void)close(n);
execl(_PATH_PR, "pr", width, length,
"-h", *title ? title : " ", 0);
"-h", *title ? title : " ", NULL);
syslog(LOG_ERR, "cannot execl %s", _PATH_PR);
exit(2);
}
@ -1123,7 +1123,7 @@ sendmail(char *user, int bombed)
cp++;
else
cp = _PATH_SENDMAIL;
execl(_PATH_SENDMAIL, cp, "-t", 0);
execl(_PATH_SENDMAIL, cp, "-t", NULL);
_exit(0);
} else if (s > 0) { /* parent */
dup2(p[1], 1);
@ -1324,7 +1324,7 @@ setup_ofilter(int check_rflag)
cp = OF;
else
cp++;
execl(OF, cp, width, length, 0);
execl(OF, cp, width, length, NULL);
syslog(LOG_ERR, "%s: %s: %m", printer, OF);
exit(1);
}