aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-11-29 06:49:36 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-11-29 06:49:36 +0000
commitab310e1b1c2f85235e61c471802b53314da919f0 (patch)
tree415cf40159a0c2b6009a27df18b0cc45bea2e956 /sysklogd
parent1cd1012a9063656a6b5b75dac8d400abd60cd643 (diff)
downloadbusybox-w32-ab310e1b1c2f85235e61c471802b53314da919f0.tar.gz
busybox-w32-ab310e1b1c2f85235e61c471802b53314da919f0.tar.bz2
busybox-w32-ab310e1b1c2f85235e61c471802b53314da919f0.zip
apply post-1.13.0 patches
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/klogd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index 723ca8067..a27ddf4f4 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -73,9 +73,6 @@ int klogd_main(int argc UNUSED_PARAM, char **argv)
73 73
74 syslog(LOG_NOTICE, "klogd started: %s", bb_banner); 74 syslog(LOG_NOTICE, "klogd started: %s", bb_banner);
75 75
76 /* Initially null terminate the buffer in case of a very long line */
77 log_buffer[KLOGD_LOGBUF_SIZE - 1] = '\0';
78
79 while (1) { 76 while (1) {
80 int n; 77 int n;
81 int priority; 78 int priority;
@@ -89,6 +86,7 @@ int klogd_main(int argc UNUSED_PARAM, char **argv)
89 errno); 86 errno);
90 break; 87 break;
91 } 88 }
89 log_buffer[used + n] = '\0';
92 90
93 /* klogctl buffer parsing modelled after code in dmesg.c */ 91 /* klogctl buffer parsing modelled after code in dmesg.c */
94 start = &log_buffer[0]; 92 start = &log_buffer[0];
@@ -101,7 +99,7 @@ int klogd_main(int argc UNUSED_PARAM, char **argv)
101 /* This line is incomplete... */ 99 /* This line is incomplete... */
102 if (start != log_buffer) { 100 if (start != log_buffer) {
103 /* move it to the front of the buffer */ 101 /* move it to the front of the buffer */
104 strcpy(log_buffer, start); 102 overlapping_strcpy(log_buffer, start);
105 /* don't log it yet */ 103 /* don't log it yet */
106 used = strlen(log_buffer); 104 used = strlen(log_buffer);
107 break; 105 break;