summaryrefslogtreecommitdiffstats
path: root/template.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-19 10:30:42 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-19 10:30:42 +0000
commitcd2b24dfc45c4b115ace6d17ab0237511fef3d66 (patch)
treede8436b5397e4248327bbddbb223d9dec6fef1ef /template.c
parent80b1798e2ddaf9ee4090321dba7465f233207682 (diff)
downloadrsyslog-cd2b24dfc45c4b115ace6d17ab0237511fef3d66.tar.gz
rsyslog-cd2b24dfc45c4b115ace6d17ab0237511fef3d66.tar.xz
rsyslog-cd2b24dfc45c4b115ace6d17ab0237511fef3d66.zip
- added doc on how expressions will work
- cleaned up the stringbuf Construct interface - did some cleanup on stringbuf calls - we now have much better interfaces and macros
Diffstat (limited to 'template.c')
-rw-r--r--template.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/template.c b/template.c
index 12096c91..9a5a2651 100644
--- a/template.c
+++ b/template.c
@@ -78,10 +78,7 @@ rsRetVal tplToString(struct template *pTpl, msg_t *pMsg, uchar** ppSz)
* free the obtained value (if requested). We continue this
* loop until we got hold of all values.
*/
- if((pCStr = rsCStrConstruct()) == NULL) {
- dbgprintf("memory shortage, tplToString failed\n");
- ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
- }
+ CHKiRet(rsCStrConstruct(&pCStr));
pTpe = pTpl->pEntryRoot;
while(pTpe != NULL) {
@@ -209,7 +206,7 @@ void doSQLEscape(uchar **pp, size_t *pLen, unsigned short *pbMustBeFreed, int es
p = *pp;
iLen = *pLen;
- if((pStrB = rsCStrConstruct()) == NULL) {
+ if(rsCStrConstruct(&pStrB) != RS_RET_OK) {
/* oops - no mem ... Do emergency... */
doSQLEmergencyEscape(p, escapeMode);
return;
@@ -323,7 +320,7 @@ static int do_Constant(unsigned char **pp, struct template *pTpl)
p = *pp;
- if((pStrB = rsCStrConstruct()) == NULL)
+ if(rsCStrConstruct(&pStrB) != RS_RET_OK)
return 1;
rsCStrSetAllocIncrement(pStrB, 32);
/* process the message and expand escapes
@@ -493,7 +490,7 @@ static int do_Parameter(unsigned char **pp, struct template *pTpl)
p = (unsigned char*) *pp;
- if((pStrB = rsCStrConstruct()) == NULL)
+ if(rsCStrConstruct(&pStrB) != RS_RET_OK)
return 1;
if((pTpe = tpeConstruct(pTpl)) == NULL) {