summaryrefslogtreecommitdiffstats
path: root/plugins/imklog/bsd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-17 16:57:51 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-17 16:57:51 +0200
commitc4bb2d1cfa92ea9ee4ece2d6f761be8079610335 (patch)
treeeaf24645a676c53595357d46ccae3e762e2c6048 /plugins/imklog/bsd.c
parentc40898739485e0a407477b41d9eb3f925995ef17 (diff)
parentd3bb17372ef3282f08e7df2d457d70677eda851f (diff)
downloadrsyslog-c4bb2d1cfa92ea9ee4ece2d6f761be8079610335.tar.gz
rsyslog-c4bb2d1cfa92ea9ee4ece2d6f761be8079610335.tar.xz
rsyslog-c4bb2d1cfa92ea9ee4ece2d6f761be8079610335.zip
Merge branch 'beta'
Diffstat (limited to 'plugins/imklog/bsd.c')
-rw-r--r--plugins/imklog/bsd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/imklog/bsd.c b/plugins/imklog/bsd.c
index 80ff9494..d4f9f773 100644
--- a/plugins/imklog/bsd.c
+++ b/plugins/imklog/bsd.c
@@ -92,7 +92,9 @@ submitSyslog(int pri, uchar *buf)
/* we now try to parse the timestamp. iff it parses, we assume
* it is a timestamp. Otherwise we know for sure it is no ts ;)
*/
- i = 4; /* first digit after '[' */
+ i = 4; /* space or first digit after '[' */
+ while(buf[i] && isspace(buf[i]))
+ ++i; /* skip space */
secs = 0;
while(buf[i] && isdigit(buf[i])) {
secs = secs * 10 + buf[i] - '0';
@@ -118,7 +120,7 @@ submitSyslog(int pri, uchar *buf)
/* we have a timestamp */
DBGPRINTF("kernel timestamp is %ld %ld\n", secs, nsecs);
bufsize= strlen((char*)buf);
- memcpy(buf+3, buf+i, bufsize - i + 1);
+ memmove(buf+3, buf+i, bufsize - i + 1);
clock_gettime(CLOCK_MONOTONIC, &monotonic);
clock_gettime(CLOCK_REALTIME, &realtime);