newsyslog wouldn't parse the count field because sscanf return value was
tested against the wrong value (0 != 1)
This commit is contained in:
parent
73683a9450
commit
51ccad7517
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: newsyslog.c,v 1.25 2000/07/07 15:42:35 ad Exp $ */
|
||||
/* $NetBSD: newsyslog.c,v 1.26 2000/07/09 12:14:01 aymeric Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 Andrew Doran <ad@NetBSD.org>
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: newsyslog.c,v 1.25 2000/07/07 15:42:35 ad Exp $");
|
||||
__RCSID("$NetBSD: newsyslog.c,v 1.26 2000/07/09 12:14:01 aymeric Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -232,7 +232,7 @@ parse(struct conf_entry *log, FILE *fd, size_t *_lineno)
|
||||
}
|
||||
log->mode = (mode_t)i;
|
||||
|
||||
if (sscanf(*ap++, "%d", &log->numhist) != 0) {
|
||||
if (sscanf(*ap++, "%d", &log->numhist) != 1) {
|
||||
warnx("config line %d: bad log count", lineno);
|
||||
return (-1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user