summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-12 11:17:20 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-12 11:17:20 +0000
commit4fb1eb8f072f2b77c5a10b9bf39d3742e16327b8 (patch)
treee1f4d208712d6aed05ff589c157283d1cb7a16c3 /syslogd.c
parent4e535179edb6e7b941276c451f6315c46dbda54a (diff)
downloadrsyslog-4fb1eb8f072f2b77c5a10b9bf39d3742e16327b8.tar.gz
rsyslog-4fb1eb8f072f2b77c5a10b9bf39d3742e16327b8.tar.xz
rsyslog-4fb1eb8f072f2b77c5a10b9bf39d3742e16327b8.zip
fixed bug that caused invalid treatment of tabs (HT) in rsyslog.conf
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/syslogd.c b/syslogd.c
index d58e6d12..e78b08a3 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -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;