diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-17 16:56:12 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-10-17 16:56:12 +0200 |
commit | a21fe156df563267a177b6fcaccaf90e227874db (patch) | |
tree | cc9dc8cdb9e30b1ab71eb5a3a0e5e71b5823ce8c /plugins/imklog | |
parent | 75079d9519c78c07004495f71ea347543a01f40e (diff) | |
parent | 0a3c0e2f4e8c98f892aab08c154c7c43a89b4102 (diff) | |
download | rsyslog-a21fe156df563267a177b6fcaccaf90e227874db.tar.gz rsyslog-a21fe156df563267a177b6fcaccaf90e227874db.tar.bz2 rsyslog-a21fe156df563267a177b6fcaccaf90e227874db.zip |
Merge branch 'v6-stable' into beta
Diffstat (limited to 'plugins/imklog')
-rw-r--r-- | plugins/imklog/bsd.c | 6 | ||||
-rw-r--r-- | plugins/imklog/solaris_cddl.c | 2 |
2 files changed, 5 insertions, 3 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); diff --git a/plugins/imklog/solaris_cddl.c b/plugins/imklog/solaris_cddl.c index 7e86c68c..cf5467fc 100644 --- a/plugins/imklog/solaris_cddl.c +++ b/plugins/imklog/solaris_cddl.c @@ -216,7 +216,7 @@ sun_getkmsg() */ remlen = buflen - len; - (void) memcpy(buf, &buf[len], remlen); + (void) memmove(buf, &buf[len], remlen); dat.maxlen = MAXLINE - remlen; dat.buf = &buf[remlen]; } else { |