summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-03-17 19:40:44 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-03-17 19:40:44 +0000
commitd56c7210e6997f393bece0935d359c05d01a0efa (patch)
tree9807932348e40879566df0fc405cff1a547d791d /usr.bin
parente3a77a309cd3e34064bed90fbff49f7c78cfb732 (diff)
Last parameter to execl[e]() functions *must* be cast to a pointer.
Just NULL is not good practise as NULL is theoretically allowed to be an integer rather than a pointer. Use (char *)NULL consistently instead of scattering a few (char *)0 and (void *)NULL into the mix. Prompted by and probably ok deraadt@ millert@ kettenis@ Definitely ok mestre@ ratchov@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ftp/cmds.c6
-rw-r--r--usr.bin/sendbug/sendbug.c4
-rw-r--r--usr.bin/usbhidaction/usbhidaction.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c
index ede6398868c..2b3bc72b79c 100644
--- a/usr.bin/ftp/cmds.c
+++ b/usr.bin/ftp/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.75 2015/10/18 03:04:11 mmcc Exp $ */
+/* $OpenBSD: cmds.c,v 1.76 2016/03/17 19:40:43 krw Exp $ */
/* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */
/*
@@ -1007,10 +1007,10 @@ shell(int argc, char *argv[])
(void)fflush(ttyout);
}
if (argc > 1) {
- execl(shellp, shellnam, "-c", altarg, (char *)0);
+ execl(shellp, shellnam, "-c", altarg, (char *)NULL);
}
else {
- execl(shellp, shellnam, (char *)0);
+ execl(shellp, shellnam, (char *)NULL);
}
warn("%s", shellp);
code = -1;
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c
index dc39073328e..bba83035ae1 100644
--- a/usr.bin/sendbug/sendbug.c
+++ b/usr.bin/sendbug/sendbug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendbug.c,v 1.73 2015/10/26 13:12:10 deraadt Exp $ */
+/* $OpenBSD: sendbug.c,v 1.74 2016/03/17 19:40:43 krw Exp $ */
/*
* Written by Ray Lai <ray@cyth.net>.
@@ -337,7 +337,7 @@ sendmail(const char *pathname)
}
close(filedes[0]);
execl(_PATH_SENDMAIL, "sendmail",
- "-oi", "-t", (void *)NULL);
+ "-oi", "-t", (char *)NULL);
warn("sendmail error: unsent report in %s",
pathname);
return (-1);
diff --git a/usr.bin/usbhidaction/usbhidaction.c b/usr.bin/usbhidaction/usbhidaction.c
index 704d4e45dac..e71e70cc73d 100644
--- a/usr.bin/usbhidaction/usbhidaction.c
+++ b/usr.bin/usbhidaction/usbhidaction.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbhidaction.c,v 1.21 2015/10/26 10:08:14 jung Exp $ */
+/* $OpenBSD: usbhidaction.c,v 1.22 2016/03/17 19:40:43 krw Exp $ */
/* $NetBSD: usbhidaction.c,v 1.7 2002/01/18 14:38:59 augustss Exp $ */
/*
@@ -441,7 +441,7 @@ docmd(struct command *cmd, int value, const char *hid, int argc, char **argv)
setpgid(0, 0);
if (verbose)
printf("executing '%s'\n", cmdbuf);
- r = execl(_PATH_BSHELL, "sh", "-c", cmdbuf, NULL);
+ r = execl(_PATH_BSHELL, "sh", "-c", cmdbuf, (char *)NULL);
err(1, "execl");
}
}