aboutsummaryrefslogtreecommitdiff
path: root/sbin/bsdlabel/bsdlabel.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2012-01-03 18:51:58 +0000
committerEd Schouten <ed@FreeBSD.org>2012-01-03 18:51:58 +0000
commitb3608ae18f1e5598bed81d0a10dd585a5080c40d (patch)
treeb751618c7a82d9c00cab91ea9f611585dbf14d84 /sbin/bsdlabel/bsdlabel.c
parent69ee3e2f52eb8cba6e103cd1de3f91a7ffe1ddc7 (diff)
downloadsrc-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 'sbin/bsdlabel/bsdlabel.c')
-rw-r--r--sbin/bsdlabel/bsdlabel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 2dcffd0a752b..a7cc2a2d4bd6 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -782,12 +782,12 @@ getasciilabel(FILE *f, struct disklabel *lp)
lp->d_sbsize = 0; /* XXX */
while (fgets(line, sizeof(line) - 1, f)) {
lineno++;
- if ((cp = index(line,'\n')) != 0)
+ if ((cp = strchr(line,'\n')) != 0)
*cp = '\0';
cp = skip(line);
if (cp == NULL)
continue;
- tp = index(cp, ':');
+ tp = strchr(cp, ':');
if (tp == NULL) {
fprintf(stderr, "line %d: syntax error\n", lineno);
errors++;