diff options
author | ed <ed@FreeBSD.org> | 2012-01-02 12:12:10 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-01-02 12:12:10 +0000 |
commit | ab210c8f2f4f0cd4839d93f66181fc7ad57ce8a9 (patch) | |
tree | c3375fb3aa9ccc6f33c26a511457552dfbab74a7 /sys/netgraph/ng_ksocket.c | |
parent | d9de01105e6c2f60ef0fb2a67c0f3d915cef8c61 (diff) | |
download | FreeBSD-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/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 20121ba..d2e3a26 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); |