diff options
-rw-r--r-- | sysklogd/syslogd.c | 6 | ||||
-rw-r--r-- | syslogd.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 14219eb54..25bc68f20 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -394,16 +394,17 @@ static int serveConnection (int conn) | |||
394 | { | 394 | { |
395 | RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); | 395 | RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); |
396 | int n_read; | 396 | int n_read; |
397 | char *p = tmpbuf; | ||
397 | 398 | ||
398 | n_read = read (conn, tmpbuf, BUFSIZE ); | 399 | n_read = read (conn, tmpbuf, BUFSIZE ); |
399 | 400 | ||
400 | if (n_read > 0) { | 401 | while (p < tmpbuf + n_read) { |
401 | 402 | ||
402 | int pri = (LOG_USER | LOG_NOTICE); | 403 | int pri = (LOG_USER | LOG_NOTICE); |
403 | char line[ BUFSIZE + 1 ]; | 404 | char line[ BUFSIZE + 1 ]; |
404 | unsigned char c; | 405 | unsigned char c; |
405 | 406 | ||
406 | char *p = tmpbuf, *q = line; | 407 | char *q = line; |
407 | 408 | ||
408 | tmpbuf[ n_read - 1 ] = '\0'; | 409 | tmpbuf[ n_read - 1 ] = '\0'; |
409 | 410 | ||
@@ -428,6 +429,7 @@ static int serveConnection (int conn) | |||
428 | p++; | 429 | p++; |
429 | } | 430 | } |
430 | *q = '\0'; | 431 | *q = '\0'; |
432 | p++; | ||
431 | /* Now log it */ | 433 | /* Now log it */ |
432 | logMessage (pri, line); | 434 | logMessage (pri, line); |
433 | } | 435 | } |
@@ -394,16 +394,17 @@ static int serveConnection (int conn) | |||
394 | { | 394 | { |
395 | RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); | 395 | RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); |
396 | int n_read; | 396 | int n_read; |
397 | char *p = tmpbuf; | ||
397 | 398 | ||
398 | n_read = read (conn, tmpbuf, BUFSIZE ); | 399 | n_read = read (conn, tmpbuf, BUFSIZE ); |
399 | 400 | ||
400 | if (n_read > 0) { | 401 | while (p < tmpbuf + n_read) { |
401 | 402 | ||
402 | int pri = (LOG_USER | LOG_NOTICE); | 403 | int pri = (LOG_USER | LOG_NOTICE); |
403 | char line[ BUFSIZE + 1 ]; | 404 | char line[ BUFSIZE + 1 ]; |
404 | unsigned char c; | 405 | unsigned char c; |
405 | 406 | ||
406 | char *p = tmpbuf, *q = line; | 407 | char *q = line; |
407 | 408 | ||
408 | tmpbuf[ n_read - 1 ] = '\0'; | 409 | tmpbuf[ n_read - 1 ] = '\0'; |
409 | 410 | ||
@@ -428,6 +429,7 @@ static int serveConnection (int conn) | |||
428 | p++; | 429 | p++; |
429 | } | 430 | } |
430 | *q = '\0'; | 431 | *q = '\0'; |
432 | p++; | ||
431 | /* Now log it */ | 433 | /* Now log it */ |
432 | logMessage (pri, line); | 434 | logMessage (pri, line); |
433 | } | 435 | } |