summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-09-19 15:27:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-09-19 15:27:32 +0000
commit8f4d28e2d4bea5b9837a7497eaa6534cd951974c (patch)
tree204d9c4768b91b4bb05e52e8a3130a570315ac90 /usr.bin
parent7b5806ae55027c83a25f2ca7c1d3580d9e794f1a (diff)
Since isspace() considers \n to be a space we need to check for start
of line == \0, not \n after stripping leading blanks. Otherwise blank lines give an error. Noticed by marc@
Diffstat (limited to 'usr.bin')
-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 430368f6f1c..2d20dec2e0c 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.53 2002/09/17 20:44:38 millert Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.54 2002/09/19 15:27:31 millert Exp $ */
/*
* Copyright (c) 1999, 2002 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -86,7 +86,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: newsyslog.c,v 1.53 2002/09/17 20:44:38 millert Exp $";
+static const char rcsid[] = "$OpenBSD: newsyslog.c,v 1.54 2002/09/19 15:27:31 millert Exp $";
#endif /* not lint */
#ifndef CONF
@@ -477,7 +477,7 @@ parse_file(int *nentries)
*nentries = 0;
while (fgets(line, sizeof(line), f)) {
tmp = sob(line);
- if (*tmp == '\n' || *tmp == '#')
+ if (*tmp == '\0' || *tmp == '#')
continue;
errline = strdup(tmp);
if (errline == NULL)