From ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 2 Jan 2012 12:12:10 +0000 Subject: Use strchr() and strrchr(). It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it. For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel. --- sys/security/mac_lomac/mac_lomac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/security/mac_lomac/mac_lomac.c') diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c index fe71681..8dc92e4 100644 --- a/sys/security/mac_lomac/mac_lomac.c +++ b/sys/security/mac_lomac/mac_lomac.c @@ -762,10 +762,10 @@ lomac_parse(struct mac_lomac *ml, char *string) /* Do we have a range? */ single = string; - range = index(string, '('); + range = strchr(string, '('); if (range == single) single = NULL; - auxsingle = index(string, '['); + auxsingle = strchr(string, '['); if (auxsingle == single) single = NULL; if (range != NULL && auxsingle != NULL) @@ -776,13 +776,13 @@ lomac_parse(struct mac_lomac *ml, char *string) *range = '\0'; range++; rangelow = range; - rangehigh = index(rangelow, '-'); + rangehigh = strchr(rangelow, '-'); if (rangehigh == NULL) return (EINVAL); rangehigh++; if (*rangelow == '\0' || *rangehigh == '\0') return (EINVAL); - rangeend = index(rangehigh, ')'); + rangeend = strchr(rangehigh, ')'); if (rangeend == NULL) return (EINVAL); if (*(rangeend + 1) != '\0') @@ -798,7 +798,7 @@ lomac_parse(struct mac_lomac *ml, char *string) /* Nul terminate the end of the single string. */ *auxsingle = '\0'; auxsingle++; - auxsingleend = index(auxsingle, ']'); + auxsingleend = strchr(auxsingle, ']'); if (auxsingleend == NULL) return (EINVAL); if (*(auxsingleend + 1) != '\0') -- cgit v1.1