summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-04-05 16:44:00 +0000
committermillert <millert@openbsd.org>2004-04-05 16:44:00 +0000
commit9f07c5e5c382872f18b2447f1872a02c5c086309 (patch)
treed6a477d482aa368b22bfdc77a68d33b2fd042c73
parent- redefine the .UL macro so that, even if output is to a non-TTY device, (diff)
downloadwireguard-openbsd-9f07c5e5c382872f18b2447f1872a02c5c086309.tar.xz
wireguard-openbsd-9f07c5e5c382872f18b2447f1872a02c5c086309.zip
In Exit() when used as a signal handler, emsg is a pointer so
sizeof() is wrong so make it a #define instead. Also avoid using a negative exit value. Found by aaron@
-rw-r--r--usr.bin/sudo/visudo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sudo/visudo.c b/usr.bin/sudo/visudo.c
index df27ab505f5..dfcdc74c579 100644
--- a/usr.bin/sudo/visudo.c
+++ b/usr.bin/sudo/visudo.c
@@ -672,14 +672,14 @@ static RETSIGTYPE
Exit(sig)
int sig;
{
- char *emsg = " exiting due to signal.\n";
+#define emsg " exiting due to signal.\n"
(void) unlink(stmp);
if (sig > 0) {
write(STDERR_FILENO, getprogname(), strlen(getprogname()));
write(STDERR_FILENO, emsg, sizeof(emsg) - 1);
- _exit(-sig);
+ _exit(sig);
}
exit(-sig);
}