From 9c4bfd8cd15f0cfcf774313ac84513f6ba6f366d Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 24 Sep 2011 20:30:12 +0200 Subject: [PATCH 1/1] bti: allow compilation on non-GNU platforms Avoid using strchrnul, it's a GNU addition. The code in question, actually doesn't really benefit from strchrnul's behaviour. Signed-off-by: Fabian Groffen Signed-off-by: Greg Kroah-Hartman --- config.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/config.c b/config.c index e06f480..2b510b9 100644 --- a/config.c +++ b/config.c @@ -351,20 +351,21 @@ void bti_parse_configfile(struct session *session) * marker if it occurs at the beginning of the line, or after * whitespace */ - hashmarker = strchrnul(line, '#'); + hashmarker = strchr(line, '#'); if (line == hashmarker) line[0] = '\0'; else { - while (hashmarker[0] != '\0') { + while (hashmarker != NULL) { --hashmarker; - if (isblank(hashmarker[0])) + if (isblank(hashmarker[0])) { hashmarker[0] = '\0'; - else { + break; + } else { /* * false positive; '#' occured * within a string */ - hashmarker = strchrnul(hashmarker+2, '#'); + hashmarker = strchr(hashmarker+2, '#'); } } } -- 2.39.5