summaryrefslogtreecommitdiffstats
path: root/runtime/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-08-31 12:18:27 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-08-31 12:18:27 +0200
commit672f45733bbcfab03e1284afc41b4b516f4f5365 (patch)
treed39dbfb1c2945209d04b75b270d9dad0ec128d6f /runtime/msg.c
parentf9dc2f787630ec9729b02ef73dd8dc5614160f13 (diff)
parent0426ad7dd27fda6854f7d306e46331387b20947a (diff)
downloadrsyslog-672f45733bbcfab03e1284afc41b4b516f4f5365.tar.gz
rsyslog-672f45733bbcfab03e1284afc41b4b516f4f5365.tar.bz2
rsyslog-672f45733bbcfab03e1284afc41b4b516f4f5365.zip
Merge branch 'master' into v7-devel
Diffstat (limited to 'runtime/msg.c')
-rw-r--r--runtime/msg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 938c4f74..3f6916cb 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -2584,9 +2584,9 @@ jsonField(struct templateEntry *pTpe, uchar **ppRes, unsigned short *pbMustBeFre
pSrc = *ppRes;
buflen = (*pBufLen == -1) ? ustrlen(pSrc) : *pBufLen;
/* we hope we have only few escapes... */
- dst = es_newStr(buflen+es_strlen(pTpe->fieldName)+15);
+ dst = es_newStr(buflen+pTpe->lenFieldName+15);
es_addChar(&dst, '"');
- es_addStr(&dst, pTpe->fieldName);
+ es_addBuf(&dst, (char*)pTpe->fieldName, pTpe->lenFieldName);
es_addBufConstcstr(&dst, "\":\"");
CHKiRet(jsonAddVal(pSrc, buflen, &dst));
es_addChar(&dst, '"');