summaryrefslogtreecommitdiff
path: root/usr.bin/newsyslog/newsyslog.c
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2001-11-24 19:53:23 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2001-11-24 19:53:23 +0000
commit6b1050890891a7514d785dfd4da8a54eb261dee7 (patch)
treee36cd0743fc0d6d64727b26a3e64f9fec9cc633d /usr.bin/newsyslog/newsyslog.c
parent77b51468f075dcd4779e982360ed5897cb91aaad (diff)
handle NL terminated pid files correctly, OK deraadt@
Diffstat (limited to 'usr.bin/newsyslog/newsyslog.c')
-rw-r--r--usr.bin/newsyslog/newsyslog.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index 9c303e62b35..7219a71d6aa 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.40 2001/11/23 04:20:56 deraadt Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.41 2001/11/24 19:53:22 marc Exp $ */
/*
* Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -88,7 +88,7 @@ provided "as is" without express or implied warranty.
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.40 2001/11/23 04:20:56 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.41 2001/11/24 19:53:22 marc Exp $";
#endif /* not lint */
#ifndef CONF
@@ -332,7 +332,7 @@ send_signal(pidfile, signal)
if (fgets(line, sizeof(line), f)) {
errno = 0;
ulval = strtoul(line, &ep, 10);
- if (line[0] == '\0' || *ep != '\0')
+ if (line[0] == '\0' || (*ep != '\0' && *ep != '\n'))
err = "invalid number in";
else if (errno == ERANGE && ulval == ULONG_MAX)
err = "out of range number in";