diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | syslogd.c | 8 |
2 files changed, 7 insertions, 2 deletions
@@ -14,6 +14,7 @@ Version 3.11.1 (rgerhards), 2008-02-?? tells this feature is not tested and probably not worth the effort. Thanks to Anders Blomdell fro bringing this to our attention - somewhat improved performance of string buffers +- fixed bug that caused invalid treatment of tabs (HT) in rsyslog.conf --------------------------------------------------------------------------- Version 3.11.0 (rgerhards), 2008-01-31 - implemented queued actions @@ -4206,17 +4206,21 @@ void sighup_handler() * \param DstSize Maximum numbers of characters to store. * \param cSep Separator char. * \ret int Returns 0 if no error occured. + * + * rgerhards, 2008-02-12: some notes are due... I will once again fix this function, this time + * so that it treats ' ' as a request for whitespace. But in general, the function and its callers + * should be changed over time, this is not really very good code... */ int getSubString(uchar **ppSrc, char *pDst, size_t DstSize, char cSep) { uchar *pSrc = *ppSrc; int iErr = 0; /* 0 = no error, >0 = error */ - while(*pSrc != cSep && *pSrc != '\n' && *pSrc != '\0' && DstSize>1) { + while((cSep == ' ' ? !isspace(*pSrc) : *pSrc != cSep) && *pSrc != '\n' && *pSrc != '\0' && DstSize>1) { *pDst++ = *(pSrc)++; DstSize--; } /* check if the Dst buffer was to small */ - if (*pSrc != cSep && *pSrc != '\n' && *pSrc != '\0') + if ((cSep == ' ' ? !isspace(*pSrc) : *pSrc != cSep) && *pSrc != '\n' && *pSrc != '\0') { dbgprintf("in getSubString, error Src buffer > Dst buffer\n"); iErr = 1; |