From 5433c6018bd3d85880ae257abe3a35b2324cdadb Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Mon, 18 Sep 2000 07:13:08 +0000 Subject: [PATCH] Mon Sep 18 09:10:47 CEST 2000: Martin Schulze Fixed bug in printchopped() that caused syslogd to emit kern.emerg messages when splitting long lines. Thanks to Daniel Jacobowitz for the fix. --- CHANGES | 2 ++ syslogd.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index cf298f2..04346b9 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,8 @@ Version 1.4 partition with no open file descriptor left over. . Solar Designer - printline() fixes + . Daniel Jacobowitz + - printchopped() fix . Keith Owens - Fixed bug that caused klogd to die if there is no sym_array available. - When symbols are expanded, print the line twice. Once with diff --git a/syslogd.c b/syslogd.c index 22572d0..27dcc2b 100644 --- a/syslogd.c +++ b/syslogd.c @@ -424,7 +424,13 @@ static char sccsid[] = "@(#)syslogd.c 5.27 (Berkeley) 10/10/88"; * . * * Sun Sep 17 21:26:16 CEST 2000: Martin Schulze - * Don't close open sockets upon reload. Thanks to Bill Nottingham. + * Don't close open sockets upon reload. Thanks to Bill + * Nottingham. + * + * Mon Sep 18 09:10:47 CEST 2000: Martin Schulze + * Fixed bug in printchopped() that caused syslogd to emit + * kern.emerg messages when splitting long lines. Thanks to + * Daniel Jacobowitz for the fix. */ @@ -1403,7 +1409,8 @@ void printchopped(hname, msg, len, fd) msg[len] = '\0'; for(p= msg+len-1; *p != '\0' && p > msg; ) --p; - ptlngth = strlen(++p); + if(*p == '\0') p++; + ptlngth = strlen(p); if ( (parts[fd] = malloc(ptlngth + 1)) == (char *) 0 ) logerror("Cannot allocate memory for message part."); else