From 909cdf33782fb9803b8e18f7f378bfcec21e4b15 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Wed, 4 Jan 2012 11:16:12 +0100 Subject: [PATCH] Fixed bug in brkstring(), newly introduced by the switch to strchr(). strchr() treats the trailing null byte surprisingly: ``The terminating null byte is considered to be part of the string.'' --- sbr/brkstring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbr/brkstring.c b/sbr/brkstring.c index 68c7b70..da42d61 100644 --- a/sbr/brkstring.c +++ b/sbr/brkstring.c @@ -46,7 +46,7 @@ brkstring(char *str, char *brksep, char *brkterm) } /* handle separators */ - while (strchr(brksep, c = *s)) { + while ((c=*s) && strchr(brksep, c)) { *s++ = '\0'; } -- 1.7.10.4