From 33232dc70bcd6223c8d47536e913edbb4be0a9f7 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 19 Oct 2005 09:37:43 +0000 Subject: added support for BSD-style host blocks --- stringbuf.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'stringbuf.c') 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 -- cgit