diff options
author | ed <ed@FreeBSD.org> | 2012-01-03 18:51:58 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-01-03 18:51:58 +0000 |
commit | e7e5b53bf16ab3b35646f0580b36fa7d7afa9678 (patch) | |
tree | b751618c7a82d9c00cab91ea9f611585dbf14d84 /lib/libstand | |
parent | d106f2fd7cf6be7617b1756d893b5b6fba5310f4 (diff) | |
download | FreeBSD-src-e7e5b53bf16ab3b35646f0580b36fa7d7afa9678.zip FreeBSD-src-e7e5b53bf16ab3b35646f0580b36fa7d7afa9678.tar.gz |
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.
Diffstat (limited to 'lib/libstand')
-rw-r--r-- | lib/libstand/bootp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libstand/bootp.c b/lib/libstand/bootp.c index eb4a8ba..904b3ba 100644 --- a/lib/libstand/bootp.c +++ b/lib/libstand/bootp.c @@ -703,13 +703,13 @@ setenv_(u_char *cp, u_char *ep, struct dhcp_opt *opts) u_char *s = NULL; /* semicolon ? */ /* skip leading whitespace */ - while (*endv && index(" \t\n\r", *endv)) + while (*endv && strchr(" \t\n\r", *endv)) endv++; - vp = index(endv, '='); /* find name=value separator */ + vp = strchr(endv, '='); /* find name=value separator */ if (!vp) break; *vp++ = 0; - if (op->fmt == __ILIST && (s = index(vp, ';'))) + if (op->fmt == __ILIST && (s = strchr(vp, ';'))) *s++ = '\0'; setenv(endv, vp, 1); vp = s; /* prepare for next round */ |