summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/syslogd.c b/syslogd.c
index 30ec2db2..f3b6ae14 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2411,8 +2411,7 @@ static int MsgSetHOSTNAME(struct msg *pMsg, char* pszHOSTNAME)
static void MsgAssignTAG(struct msg *pMsg, char *pBuf)
{
assert(pMsg != NULL);
- assert(pBuf != NULL);
- pMsg->iLenTAG = strlen(pBuf);
+ pMsg->iLenTAG = (pBuf == NULL) ? 0 : strlen(pBuf);
pMsg->pszTAG = pBuf;
}
@@ -3767,6 +3766,7 @@ void logmsg(int pri, struct msg *pMsg, int flags)
rsCStrAppendChar(pStrB, ':');
}
rsCStrFinish(pStrB);
+
MsgAssignTAG(pMsg, rsCStrConvSzStrAndDestruct(pStrB));
} else {
/* we have no TAG, so we ... */