summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2004-05-18 15:53:58 +0000
committerstefanf <stefanf@FreeBSD.org>2004-05-18 15:53:58 +0000
commitf4d682445c8ea834a5a3f044a6cbbd1b33c00737 (patch)
tree3c3b188e6c2503c4c8a2aad9d419dc8a374e3fba
parent3690fa9bf90a213884177d7788a2e85a7482fe18 (diff)
downloadFreeBSD-src-f4d682445c8ea834a5a3f044a6cbbd1b33c00737.zip
FreeBSD-src-f4d682445c8ea834a5a3f044a6cbbd1b33c00737.tar.gz
Don't depend on NULL's expansion being a pointer, cast it before it is passed
to variadic functions. Approved by: das (mentor)
-rw-r--r--lib/libutil/pw_util.c7
-rw-r--r--usr.bin/m4/gnum4.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c
index 708583d..90c9d72 100644
--- a/lib/libutil/pw_util.c
+++ b/lib/libutil/pw_util.c
@@ -266,10 +266,11 @@ pw_mkdb(const char *user)
/* child */
if (user == NULL)
execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
- "-d", passwd_dir, tempname, NULL);
+ "-d", passwd_dir, tempname, (char *)NULL);
else
execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
- "-d", passwd_dir, "-u", user, tempname, NULL);
+ "-d", passwd_dir, "-u", user, tempname,
+ (char *)NULL);
_exit(1);
/* NOTREACHED */
default:
@@ -321,7 +322,7 @@ pw_edit(int notsetuid)
(void)setuid(getuid());
}
errno = 0;
- execlp(editor, basename(editor), tempname, NULL);
+ execlp(editor, basename(editor), tempname, (char *)NULL);
_exit(errno);
default:
/* parent */
diff --git a/usr.bin/m4/gnum4.c b/usr.bin/m4/gnum4.c
index 85a937c..8940bb8 100644
--- a/usr.bin/m4/gnum4.c
+++ b/usr.bin/m4/gnum4.c
@@ -499,7 +499,7 @@ doesyscmd(const char *cmd)
(void) close(p[0]);
(void) dup2(p[1], 1);
(void) close(p[1]);
- execl(_PATH_BSHELL, "sh", "-c", cmd, NULL);
+ execl(_PATH_BSHELL, "sh", "-c", cmd, (char *)NULL);
exit(1);
default:
/* Read result in two stages, since m4's buffer is
OpenPOWER on IntegriCloud