summaryrefslogtreecommitdiffstats
path: root/stringbuf.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-09-04 16:30:32 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-09-04 16:30:32 +0000
commit372de71a1f6df161218c7135f9b4af3119869c99 (patch)
treec4e0b1cb7834151482f95ac2f89f1d8949cc0ae3 /stringbuf.c
parent32a4ca3304119eb074869dfc61f272cde0dc0380 (diff)
downloadrsyslog-372de71a1f6df161218c7135f9b4af3119869c99.tar.gz
rsyslog-372de71a1f6df161218c7135f9b4af3119869c99.tar.xz
rsyslog-372de71a1f6df161218c7135f9b4af3119869c99.zip
changed some calles to CStr class to their "safe" counterpart - they could
case program aborts if the object in question was an empty string
Diffstat (limited to 'stringbuf.c')
-rwxr-xr-xstringbuf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/stringbuf.c b/stringbuf.c
index c737e3fe..7ed77731 100755
--- a/stringbuf.c
+++ b/stringbuf.c
@@ -257,6 +257,8 @@ rsRetVal rsCStrSetSzStr(rsCStrObj *pThis, uchar *pszNew)
* the CStr object currently holds a NULL pointer string buffer. If so,
* "" is returned.
* rgerhards 2005-10-19
+ * WARNING: The returned pointer MUST NOT be freed, as it may be
+ * obtained from that constant memory pool (in case of NULL!)
*/
uchar* rsCStrGetSzStrNoNULL(rsCStrObj *pThis)
{
@@ -685,11 +687,12 @@ int rsCStrLocateInSzStr(rsCStrObj *pThis, uchar *sz)
}
+#if 0 /* read comment below why this is commented out. In short: for future use! */
/* locate the first occurence of a standard sz string inside a rsCStr object.
* Returns the offset (0-bound) of this first occurrence. If not found, -1 is
* returned.
* rgerhards 2005-09-19
- * WARNING: i accidently created this function (I later noticed I didn't relly
+ * WARNING: I accidently created this function (I later noticed I didn't relly
* need it... I will not remove the function, as it probably is useful
* some time later. However, it is not fully tested, so start with testing
* it before you put it to first use).
@@ -731,6 +734,7 @@ int rsCStrLocateSzStr(rsCStrObj *pThis, uchar *sz)
return(bFound ? i : -1);
}
+#endif /* end comment out */
/*