diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-04-09 13:00:56 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-04-09 13:00:56 +0200 |
commit | 8f0a8076cc8194036dbd4edca1c2c30a7822dd09 (patch) | |
tree | a7fd5bacf8d80fff628421186662d91705bdb8f1 /runtime/parser.c | |
parent | c1e3a032b447487ced9873b98a015046778d2b04 (diff) | |
parent | 87a957b0f5686ec3a50c98f3d1cf3019b636e700 (diff) | |
download | rsyslog-8f0a8076cc8194036dbd4edca1c2c30a7822dd09.tar.gz rsyslog-8f0a8076cc8194036dbd4edca1c2c30a7822dd09.tar.xz rsyslog-8f0a8076cc8194036dbd4edca1c2c30a7822dd09.zip |
Merge branch 'beta' into master
Conflicts:
ChangeLog
configure.ac
plugins/imudp/imudp.c
runtime/stream.h
tests/Makefile.am
tests/diag.sh
tools/omfile.c
Diffstat (limited to 'runtime/parser.c')
-rw-r--r-- | runtime/parser.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/parser.c b/runtime/parser.c index ca31b35d..6238fa64 100644 --- a/runtime/parser.c +++ b/runtime/parser.c @@ -319,7 +319,10 @@ SanitizeMsg(msg_t *pMsg) pszMsg = pMsg->pszRawMsg; lenMsg = pMsg->iLenRawMsg; - /* remove NUL character at end of message (see comment in function header) */ + /* remove NUL character at end of message (see comment in function header) + * Note that we do not need to add a NUL character in this case, because it + * is already present ;) + */ if(pszMsg[lenMsg-1] == '\0') { DBGPRINTF("dropped NUL at very end of message\n"); bUpdatedLen = TRUE; @@ -333,8 +336,9 @@ SanitizeMsg(msg_t *pMsg) */ if(bDropTrailingLF && pszMsg[lenMsg-1] == '\n') { DBGPRINTF("dropped LF at very end of message (DropTrailingLF is set)\n"); - bUpdatedLen = TRUE; lenMsg--; + pszMsg[lenMsg] = '\0'; + bUpdatedLen = TRUE; } /* it is much quicker to sweep over the message and see if it actually @@ -404,6 +408,7 @@ SanitizeMsg(msg_t *pMsg) } ++iSrc; } + pDst[iDst] = '\0'; MsgSetRawMsg(pMsg, (char*)pDst, iDst); /* save sanitized string */ |