diff options
author | Ed Schouten <ed@FreeBSD.org> | 2012-01-02 12:12:10 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2012-01-02 12:12:10 +0000 |
commit | dc15eac046a11d0a831eedf97459900227c50fb8 (patch) | |
tree | c3375fb3aa9ccc6f33c26a511457552dfbab74a7 /sys/netgraph/ng_ksocket.c | |
parent | 762ad1d61427188c189f601d7315496ca15e9e4f (diff) | |
download | src-dc15eac046a11d0a831eedf97459900227c50fb8.tar.gz src-dc15eac046a11d0a831eedf97459900227c50fb8.zip |
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.
Notes
Notes:
svn path=/head/; revision=229272
Diffstat (limited to 'sys/netgraph/ng_ksocket.c')
-rw-r--r-- | sys/netgraph/ng_ksocket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c index 20121baec750..d2e3a26400d3 100644 --- a/sys/netgraph/ng_ksocket.c +++ b/sys/netgraph/ng_ksocket.c @@ -223,7 +223,7 @@ ng_ksocket_sockaddr_parse(const struct ng_parse_type *type, /* Get socket address family followed by a slash */ while (isspace(s[*off])) (*off)++; - if ((t = index(s + *off, '/')) == NULL) + if ((t = strchr(s + *off, '/')) == NULL) return (EINVAL); if ((len = t - (s + *off)) > sizeof(fambuf) - 1) return (EINVAL); @@ -565,14 +565,14 @@ ng_ksocket_newhook(node_p node, hook_p hook, const char *name0) /* Extract family, type, and protocol from hook name */ snprintf(name, sizeof(name), "%s", name0); s1 = name; - if ((s2 = index(s1, '/')) == NULL) + if ((s2 = strchr(s1, '/')) == NULL) return (EINVAL); *s2++ = '\0'; family = ng_ksocket_parse(ng_ksocket_families, s1, 0); if (family == -1) return (EINVAL); s1 = s2; - if ((s2 = index(s1, '/')) == NULL) + if ((s2 = strchr(s1, '/')) == NULL) return (EINVAL); *s2++ = '\0'; type = ng_ksocket_parse(ng_ksocket_types, s1, 0); |