summaryrefslogtreecommitdiffstats
path: root/runtime/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-15 12:31:56 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-15 12:31:56 +0200
commit706ddb492345e53d36084d0b843f237da865c6d4 (patch)
tree5c21c06e0f4c0ce15fa2d8413c149d687be43e72 /runtime/msg.c
parenta3a3a322d8c7d40dfed0765457d26a484a624bce (diff)
parent2014cf85627b8774e8c36ddecad04f1ebf43020b (diff)
downloadrsyslog-706ddb492345e53d36084d0b843f237da865c6d4.tar.gz
rsyslog-706ddb492345e53d36084d0b843f237da865c6d4.tar.bz2
rsyslog-706ddb492345e53d36084d0b843f237da865c6d4.zip
Merge branch 'master' into master-ratelimit
Conflicts: ChangeLog doc/v7compatibility.html
Diffstat (limited to 'runtime/msg.c')
-rw-r--r--runtime/msg.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index d3c814e2..d874178b 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -2698,6 +2698,7 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
uchar *pBuf;
int iLen;
short iOffs;
+ enum tplFormatTypes datefmt;
BEGINfunc
assert(pMsg != NULL);
@@ -2717,7 +2718,11 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
bufLen = getMSGLen(pMsg);
break;
case PROP_TIMESTAMP:
- pRes = (uchar*)getTimeReported(pMsg, pTpe->data.field.eDateFormat);
+ if (pTpe != NULL)
+ datefmt = pTpe->data.field.eDateFormat;
+ else
+ datefmt = tplFmtDefault;
+ pRes = (uchar*)getTimeReported(pMsg, datefmt);
break;
case PROP_HOSTNAME:
pRes = (uchar*)getHOSTNAME(pMsg);
@@ -2767,7 +2772,11 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
pRes = (uchar*)getSeverityStr(pMsg);
break;
case PROP_TIMEGENERATED:
- pRes = (uchar*)getTimeGenerated(pMsg, pTpe->data.field.eDateFormat);
+ if (pTpe != NULL)
+ datefmt = pTpe->data.field.eDateFormat;
+ else
+ datefmt = tplFmtDefault;
+ pRes = (uchar*)getTimeGenerated(pMsg, datefmt);
break;
case PROP_PROGRAMNAME:
pRes = getProgramName(pMsg, LOCK_MUTEX);