Permalink
Browse files

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 <grobian@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information...
1 parent 288d1b0 commit 9c4bfd8cd15f0cfcf774313ac84513f6ba6f366d @grobian grobian committed with Sep 24, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 config.c
View
@@ -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, '#');
}
}
}

0 comments on commit 9c4bfd8

Please sign in to comment.