diff options
author | ache <ache@FreeBSD.org> | 2000-04-18 01:12:27 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2000-04-18 01:12:27 +0000 |
commit | 2e1592d902d16ed9876e30509b0d925e1a30e2c7 (patch) | |
tree | 5f7363ae0f7ffcd6a33f1185b10d323eb5786e86 /usr.sbin/syslogd/syslogd.c | |
parent | 4aa66e64cde631bffbc432db2f999c2139404fac (diff) | |
download | FreeBSD-src-2e1592d902d16ed9876e30509b0d925e1a30e2c7.zip FreeBSD-src-2e1592d902d16ed9876e30509b0d925e1a30e2c7.tar.gz |
Enable 8bit chars excepting high controls
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 0727b2b..ca5391d 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -577,9 +577,14 @@ printline(hname, msg) q = line; - while ((c = *p++ & 0177) != '\0' && - q < &line[sizeof(line) - 1]) - if (iscntrl(c)) + while ((c = (unsigned char)*p++) != '\0' && + q < &line[sizeof(line) - 3]) { + if ((c & 0x80) && c < 0xA0) { + c &= 0x7F; + *q++ = 'M'; + *q++ = '-'; + } + if (isascii(c) && iscntrl(c)) { if (c == '\n') *q++ = ' '; else if (c == '\t') @@ -588,8 +593,9 @@ printline(hname, msg) *q++ = '^'; *q++ = c ^ 0100; } - else + } else *q++ = c; + } *q = '\0'; logmsg(pri, line, hname, 0); |