prevent one byte overrun in printline()

This commit is contained in:
sommerfeld 2000-09-13 15:46:32 +00:00
parent 72a24b4eae
commit b6f7dd7187
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: syslogd.c,v 1.39 2000/07/02 02:15:34 jwise Exp $ */
/* $NetBSD: syslogd.c,v 1.40 2000/09/13 15:46:32 sommerfeld Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#else
__RCSID("$NetBSD: syslogd.c,v 1.39 2000/07/02 02:15:34 jwise Exp $");
__RCSID("$NetBSD: syslogd.c,v 1.40 2000/09/13 15:46:32 sommerfeld Exp $");
#endif
#endif /* not lint */
@ -533,7 +533,7 @@ printline(hname, msg)
q = line;
while ((c = *p++ & 0177) != '\0' &&
q < &line[sizeof(line) - 1])
q < &line[sizeof(line) - 2])
if (iscntrl(c))
if (c == '\n')
*q++ = ' ';