diff options
author | Michael Biebl <biebl@debian.org> | 2014-05-16 14:51:51 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2014-05-16 14:51:51 +0200 |
commit | f1040389ccb2430b9ab2ba3209aa28a62565b721 (patch) | |
tree | c6bf609292b6f3a80754c2d01cc8855a36ac7a37 /runtime/msg.c | |
parent | 9374a46543e9c43c009f80def8c3b2506b0b377e (diff) | |
download | rsyslog-f1040389ccb2430b9ab2ba3209aa28a62565b721.tar.gz |
Imported Upstream version 8.2.1upstream/8.2.1
Diffstat (limited to 'runtime/msg.c')
-rw-r--r-- | runtime/msg.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index 2959796..ded8cfe 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -7,7 +7,7 @@ * of the "old" message code without any modifications. However, it * helps to have things at the right place one we go to the meat of it. * - * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2014 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -1418,7 +1418,7 @@ static void msgSetUUID(msg_t * const pM) uuid_t uuid; static pthread_mutex_t mutUUID = PTHREAD_MUTEX_INITIALIZER; - dbgprintf("[MsgSetUUID] START\n"); + dbgprintf("[MsgSetUUID] START, lenRes %llu\n", (long long unsigned) lenRes); assert(pM != NULL); if((pM->pszUUID = (uchar*) MALLOC(lenRes)) == NULL) { @@ -1432,8 +1432,8 @@ static void msgSetUUID(msg_t * const pM) pM->pszUUID[byte_nbr * 2 + 1] = hex_char[uuid [byte_nbr] & 15]; } + pM->pszUUID[lenRes-1] = '\0'; dbgprintf("[MsgSetUUID] UUID : %s LEN: %d \n", pM->pszUUID, (int)lenRes); - pM->pszUUID[lenRes] = '\0'; } dbgprintf("[MsgSetUUID] END\n"); } @@ -1794,7 +1794,7 @@ MsgSetAfterPRIOffs(msg_t * const pMsg, short offs) * which already obtained the lock. So in general, this function here must * only be called when it it safe to do so without it aquiring a lock. */ -rsRetVal MsgSetAPPNAME(msg_t * const pMsg, char* pszAPPNAME) +rsRetVal MsgSetAPPNAME(msg_t *__restrict__ const pMsg, const char* pszAPPNAME) { DEFiRet; assert(pMsg != NULL); @@ -1812,7 +1812,7 @@ finalize_it: /* rgerhards 2004-11-24: set PROCID in msg object */ -rsRetVal MsgSetPROCID(msg_t * const pMsg, char* pszPROCID) +rsRetVal MsgSetPROCID(msg_t *__restrict__ const pMsg, const char* pszPROCID) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); @@ -1881,7 +1881,7 @@ char *getPROCID(msg_t * const pM, sbool bLockMutex) /* rgerhards 2004-11-24: set MSGID in msg object */ -rsRetVal MsgSetMSGID(msg_t * const pMsg, char* pszMSGID) +rsRetVal MsgSetMSGID(msg_t * const pMsg, const char* pszMSGID) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); @@ -1941,7 +1941,7 @@ void MsgSetRuleset(msg_t * const pMsg, ruleset_t *pRuleset) /* set TAG in msg object * (rewritten 2009-06-18 rgerhards) */ -void MsgSetTAG(msg_t * const pMsg, uchar* pszBuf, size_t lenBuf) +void MsgSetTAG(msg_t *__restrict__ const pMsg, const uchar* pszBuf, const size_t lenBuf) { uchar *pBuf; assert(pMsg != NULL); @@ -2084,7 +2084,7 @@ uchar *getRcvFrom(msg_t * const pM) /* rgerhards 2004-11-24: set STRUCTURED DATA in msg object */ -rsRetVal MsgSetStructuredData(msg_t * const pMsg, char* pszStrucData) +rsRetVal MsgSetStructuredData(msg_t * const pMsg, const char* pszStrucData) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); @@ -2264,7 +2264,7 @@ void MsgSetRcvFrom(msg_t *pThis, prop_t *new) * name (but it works only for the immediate previous). * rgerhards, 2009-06-31 */ -void MsgSetRcvFromStr(msg_t *pThis, uchar *psz, int len, prop_t **ppProp) +void MsgSetRcvFromStr(msg_t * const pThis, const uchar *psz, const int len, prop_t **ppProp) { assert(pThis != NULL); assert(ppProp != NULL); @@ -2299,7 +2299,7 @@ rsRetVal MsgSetRcvFromIP(msg_t *pThis, prop_t *new) * name (but it works only for the immediate previous). * rgerhards, 2009-06-31 */ -rsRetVal MsgSetRcvFromIPStr(msg_t *pThis, uchar *psz, int len, prop_t **ppProp) +rsRetVal MsgSetRcvFromIPStr(msg_t *const pThis, const uchar *psz, const int len, prop_t **ppProp) { DEFiRet; assert(pThis != NULL); |