summaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-28 15:33:34 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-28 15:33:34 +0000
commit1e4963f7fb25763c8ec9b9edc4c5ffdd6a0c5409 (patch)
treec08ee4e5072738915fe43bd904d828d4a2780500 /msg.c
parent6b9369c95f8dab6571ae508311a6318bddfd7cc9 (diff)
downloadrsyslog-1e4963f7fb25763c8ec9b9edc4c5ffdd6a0c5409.tar.gz
rsyslog-1e4963f7fb25763c8ec9b9edc4c5ffdd6a0c5409.tar.bz2
rsyslog-1e4963f7fb25763c8ec9b9edc4c5ffdd6a0c5409.zip
bugfix: regular expressions inside property replacer did not work properly
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/msg.c b/msg.c
index fa3e747f..3473495c 100644
--- a/msg.c
+++ b/msg.c
@@ -1336,8 +1336,8 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
#ifdef FEATURE_REGEXP
/* Variables necessary for regular expression matching */
- size_t nmatch = 2;
- regmatch_t pmatch[2];
+ size_t nmatch = 1;
+ regmatch_t pmatch[1];
#endif
assert(pMsg != NULL);
@@ -1582,7 +1582,7 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
int iLenBuf;
char *pB;
- iLenBuf = pmatch[1].rm_eo - pmatch[1].rm_so;
+ iLenBuf = pmatch[0].rm_eo - pmatch[0].rm_so;
pB = (char *) malloc((iLenBuf + 1) * sizeof(char));
if (pB == NULL) {
@@ -1593,7 +1593,7 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
}
/* Lets copy the matched substring to the buffer */
- memcpy(pB, pRes + pmatch[1].rm_so, iLenBuf);
+ memcpy(pB, pRes + pmatch[0].rm_so, iLenBuf);
pB[iLenBuf] = '\0';/* terminate string, did not happen before */
if (*pbMustBeFreed == 1)