summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_lomac/mac_lomac.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-01-02 12:12:10 +0000
committered <ed@FreeBSD.org>2012-01-02 12:12:10 +0000
commitab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9 (patch)
treec3375fb3aa9ccc6f33c26a511457552dfbab74a7 /sys/security/mac_lomac/mac_lomac.c
parentd9de01105e6c2f60ef0fb2a67c0f3d915cef8c61 (diff)
downloadFreeBSD-src-ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9.zip
FreeBSD-src-ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9.tar.gz
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.
Diffstat (limited to 'sys/security/mac_lomac/mac_lomac.c')
-rw-r--r--sys/security/mac_lomac/mac_lomac.c10
1 files changed, 5 insertions, 5 deletions
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')
OpenPOWER on IntegriCloud