diff options
author | Ed Schouten <ed@FreeBSD.org> | 2012-01-03 18:51:58 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2012-01-03 18:51:58 +0000 |
commit | b3608ae18f1e5598bed81d0a10dd585a5080c40d (patch) | |
tree | b751618c7a82d9c00cab91ea9f611585dbf14d84 /lib/libc/net/gethostbynis.c | |
parent | 69ee3e2f52eb8cba6e103cd1de3f91a7ffe1ddc7 (diff) | |
download | src-b3608ae18f1e5598bed81d0a10dd585a5080c40d.tar.gz src-b3608ae18f1e5598bed81d0a10dd585a5080c40d.zip |
Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.
This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
Notes
Notes:
svn path=/head/; revision=229403
Diffstat (limited to 'lib/libc/net/gethostbynis.c')
-rw-r--r-- | lib/libc/net/gethostbynis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c index 11de8ae40535..c0d51777adbe 100644 --- a/lib/libc/net/gethostbynis.c +++ b/lib/libc/net/gethostbynis.c @@ -91,7 +91,7 @@ _gethostbynis(const char *name, char *map, int af, struct hostent *he, free(result); result = (char *)&ypbuf; - if ((cp = index(result, '\n'))) + if ((cp = strchr(result, '\n'))) *cp = '\0'; cp = strpbrk(result, " \t"); |