Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/syslogd Don't prematurely terminate log message on ...



details:   https://anonhg.NetBSD.org/src/rev/449ef3192740
branches:  trunk
changeset: 497071:449ef3192740
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Mon Sep 18 13:04:53 2000 +0000

description:
Don't prematurely terminate log message on a 0x80 character

diffstat:

 usr.sbin/syslogd/syslogd.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r c76cc6214823 -r 449ef3192740 usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c        Mon Sep 18 12:58:55 2000 +0000
+++ b/usr.sbin/syslogd/syslogd.c        Mon Sep 18 13:04:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syslogd.c,v 1.41 2000/09/13 21:20:21 tron Exp $        */
+/*     $NetBSD: syslogd.c,v 1.42 2000/09/18 13:04:53 sommerfeld Exp $  */
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)syslogd.c  8.3 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: syslogd.c,v 1.41 2000/09/13 21:20:21 tron Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.42 2000/09/18 13:04:53 sommerfeld Exp $");
 #endif
 #endif /* not lint */
 
@@ -535,8 +535,9 @@
 
        q = line;
 
-       while ((c = *p++ & 0177) != '\0' &&
-           q < &line[sizeof(line) - 2])
+       while ((c = *p++) != '\0' &&
+           q < &line[sizeof(line) - 2]) {
+               c &= 0177;
                if (iscntrl(c))
                        if (c == '\n')
                                *q++ = ' ';
@@ -548,6 +549,7 @@
                        }
                else
                        *q++ = c;
+       }
        *q = '\0';
 
        logmsg(pri, line, hname, 0);



Home | Main Index | Thread Index | Old Index