summaryrefslogtreecommitdiffstats
path: root/stringbuf.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-10-19 09:37:43 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-10-19 09:37:43 +0000
commit33232dc70bcd6223c8d47536e913edbb4be0a9f7 (patch)
tree883e2dded58f727f04e0f00f9c660cfd18f9b275 /stringbuf.c
parent629a7a4fec13ebfa079883d83625cfa6578e931c (diff)
downloadrsyslog-33232dc70bcd6223c8d47536e913edbb4be0a9f7.tar.gz
rsyslog-33232dc70bcd6223c8d47536e913edbb4be0a9f7.tar.xz
rsyslog-33232dc70bcd6223c8d47536e913edbb4be0a9f7.zip
added support for BSD-style host blocks
Diffstat (limited to 'stringbuf.c')
-rwxr-xr-xstringbuf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/stringbuf.c b/stringbuf.c
index 28b3c14f..fb9a9f46 100755
--- a/stringbuf.c
+++ b/stringbuf.c
@@ -99,14 +99,16 @@ rsRetVal rsCStrConstructFromCStr(rsCStrObj **ppThis, rsCStrObj *pFrom)
void rsCStrDestruct(rsCStrObj *pThis)
{
-# if STRINGBUF_TRIM_ALLOCSIZE == 1
- /* in this mode, a new buffer already was allocated,
- * so we need to free the old one.
+ /* rgerhards 2005-10-19: The free of pBuf was contained in conditional compilation.
+ * The code was only compiled if STRINGBUF_TRIM_ALLOCSIZE was set to 1. I honestly
+ * do not know why it was so, I think it was an artefact. Anyhow, I have changed this
+ * now. Should there any issue occur, this comment hopefully will shed some light
+ * on what happened. I re-verified, and this function has never before been called
+ * by anyone. So changing it can have no impact for obvious reasons...
*/
- if(pThis->pBuf != NULL) {
- free(pThis->pBuf);
- }
-# endif
+ if(pThis->pBuf != NULL) {
+ free(pThis->pBuf);
+ }
if(pThis->pszBuf != NULL) {
free(pThis->pszBuf);
@@ -538,6 +540,7 @@ int rsCStrSzStrCmp(rsCStrObj *pCS1, char *psz, int iLenSz)
{
rsCHECKVALIDOBJECT(pCS1, OIDrsCStr);
assert(psz != NULL);
+printf("strlen('%s'): %d, given %d\n", psz, strlen(psz), iLenSz);
assert(iLenSz == strlen(psz)); /* just make sure during debugging! */
if(pCS1->iStrLen == iLenSz)
/* we are using iLenSz below, because the lengths