diff options
author | Denis Vlasenko | 2008-11-29 06:49:36 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-11-29 06:49:36 +0000 |
commit | ab310e1b1c2f85235e61c471802b53314da919f0 (patch) | |
tree | 415cf40159a0c2b6009a27df18b0cc45bea2e956 /sysklogd/klogd.c | |
parent | 1cd1012a9063656a6b5b75dac8d400abd60cd643 (diff) | |
download | busybox-ab310e1b1c2f85235e61c471802b53314da919f0.zip busybox-ab310e1b1c2f85235e61c471802b53314da919f0.tar.gz |
apply post-1.13.0 patches
Diffstat (limited to 'sysklogd/klogd.c')
-rw-r--r-- | sysklogd/klogd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index 723ca80..a27ddf4 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c @@ -73,9 +73,6 @@ int klogd_main(int argc UNUSED_PARAM, char **argv) syslog(LOG_NOTICE, "klogd started: %s", bb_banner); - /* Initially null terminate the buffer in case of a very long line */ - log_buffer[KLOGD_LOGBUF_SIZE - 1] = '\0'; - while (1) { int n; int priority; @@ -89,6 +86,7 @@ int klogd_main(int argc UNUSED_PARAM, char **argv) errno); break; } + log_buffer[used + n] = '\0'; /* klogctl buffer parsing modelled after code in dmesg.c */ start = &log_buffer[0]; @@ -101,7 +99,7 @@ int klogd_main(int argc UNUSED_PARAM, char **argv) /* This line is incomplete... */ if (start != log_buffer) { /* move it to the front of the buffer */ - strcpy(log_buffer, start); + overlapping_strcpy(log_buffer, start); /* don't log it yet */ used = strlen(log_buffer); break; |