diff options
-rw-r--r-- | runtime/msg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index 7e01b185..f634329f 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -2470,11 +2470,17 @@ typedef enum ENOWType { NOW_NOW, NOW_YEAR, NOW_MONTH, NOW_DAY, NOW_HOUR, NOW_HHO static uchar *getNOW(eNOWType eNow, struct syslogTime *t) { uchar *pBuf; + struct syslogTime tt; if((pBuf = (uchar*) MALLOC(sizeof(uchar) * tmpBUFSIZE)) == NULL) { return NULL; } + if(t == NULL) { /* can happen if called via script engine */ + datetime.getCurrTime(&tt, NULL); + t = &tt; + } + if(t->year == 0) { /* not yet set! */ datetime.getCurrTime(t, NULL); } |