diff options
author | Robert Griebl <griebl@gmx.de> | 2002-07-19 20:52:21 +0000 |
---|---|---|
committer | Robert Griebl <griebl@gmx.de> | 2002-07-19 20:52:21 +0000 |
commit | fc78b795758ad04caeadfbb2bbb75e6cefa03785 (patch) | |
tree | e5033fb9ba1ae0b24582730f66bce03fb64da529 | |
parent | efd4983eb1e6a196bc9d20b0b8840b79cb0f308c (diff) | |
download | busybox-fc78b795758ad04caeadfbb2bbb75e6cefa03785.tar.gz |
Applied syslogd fix submitted by Bart Visscher:
I am using BB 0.60.2 in a floppy distro, and the syslog (and logger) is
unable to log the "<" char. This shows up in ppp logfiles. [...]
#logger "<pcomp>" results in "comp>" arriving at the log.
-rw-r--r-- | sysklogd/syslogd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index e1e71378c..3c18c507f 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -411,14 +411,16 @@ static int serveConnection (int conn) int pri = (LOG_USER | LOG_NOTICE); char line[ BUFSIZE + 1 ]; unsigned char c; + int gotpri = 0; char *q = line; tmpbuf[ n_read - 1 ] = '\0'; while (p && (c = *p) && q < &line[ sizeof (line) - 1 ]) { - if (c == '<') { + if ((c == '<') && !gotpri && isdigit(p[1])) { /* Parse the magic priority number. */ + gotpri = 1; pri = 0; while (isdigit (*(++p))) { pri = 10 * pri + (*p - '0'); |