aboutsummaryrefslogtreecommitdiff
path: root/sysklogd/syslogd.c
diff options
context:
space:
mode:
authorsandman <sandman@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-07-19 20:52:21 +0000
committersandman <sandman@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-07-19 20:52:21 +0000
commit89025b51201240d76228179ce321fda17f8f285e (patch)
treee5033fb9ba1ae0b24582730f66bce03fb64da529 /sysklogd/syslogd.c
parentf8b1b7e99c0675194fb9aff3ea7b30ca536269df (diff)
downloadbusybox-w32-89025b51201240d76228179ce321fda17f8f285e.tar.gz
busybox-w32-89025b51201240d76228179ce321fda17f8f285e.tar.bz2
busybox-w32-89025b51201240d76228179ce321fda17f8f285e.zip
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. git-svn-id: svn://busybox.net/trunk/busybox@5071 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sysklogd/syslogd.c')
-rw-r--r--sysklogd/syslogd.c4
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)
411 int pri = (LOG_USER | LOG_NOTICE); 411 int pri = (LOG_USER | LOG_NOTICE);
412 char line[ BUFSIZE + 1 ]; 412 char line[ BUFSIZE + 1 ];
413 unsigned char c; 413 unsigned char c;
414 int gotpri = 0;
414 415
415 char *q = line; 416 char *q = line;
416 417
417 tmpbuf[ n_read - 1 ] = '\0'; 418 tmpbuf[ n_read - 1 ] = '\0';
418 419
419 while (p && (c = *p) && q < &line[ sizeof (line) - 1 ]) { 420 while (p && (c = *p) && q < &line[ sizeof (line) - 1 ]) {
420 if (c == '<') { 421 if ((c == '<') && !gotpri && isdigit(p[1])) {
421 /* Parse the magic priority number. */ 422 /* Parse the magic priority number. */
423 gotpri = 1;
422 pri = 0; 424 pri = 0;
423 while (isdigit (*(++p))) { 425 while (isdigit (*(++p))) {
424 pri = 10 * pri + (*p - '0'); 426 pri = 10 * pri + (*p - '0');