diff options
author | Michael Biebl <biebl@debian.org> | 2012-10-16 16:44:03 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2012-10-16 16:44:03 +0200 |
commit | 1fc4db11217caa3faebbfde8bd310fb64c9f860c (patch) | |
tree | 39fca9174460f0a55e46b67793dea0c35e537ac0 /runtime/msg.c | |
parent | 64b89c604c6cec4fd0de51f2776f95b34e388bae (diff) | |
download | rsyslog-1fc4db11217caa3faebbfde8bd310fb64c9f860c.tar.gz |
Imported Upstream version 7.1.11upstream/7.1.11
Diffstat (limited to 'runtime/msg.c')
-rw-r--r-- | runtime/msg.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index d3c814e..d874178 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); |