diff options
Diffstat (limited to 'usr.bin/hexdump')
-rw-r--r-- | usr.bin/hexdump/display.c | 2 | ||||
-rw-r--r-- | usr.bin/hexdump/hexdump.c | 2 | ||||
-rw-r--r-- | usr.bin/hexdump/hexsyntax.c | 2 | ||||
-rw-r--r-- | usr.bin/hexdump/parse.c | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index 991509d..a5f2a47 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -220,7 +220,7 @@ bpad(PR *pr) pr->cchar[0] = 's'; pr->cchar[1] = '\0'; for (p1 = pr->fmt; *p1 != '%'; ++p1); - for (p2 = ++p1; *p1 && index(spec, *p1); ++p1); + for (p2 = ++p1; *p1 && strchr(spec, *p1); ++p1); while ((*p2++ = *p1++)); } diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c index c3aaab5..d3c4bb5 100644 --- a/usr.bin/hexdump/hexdump.c +++ b/usr.bin/hexdump/hexdump.c @@ -61,7 +61,7 @@ main(int argc, char *argv[]) (void)setlocale(LC_ALL, ""); - if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od")) + if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od")) newsyntax(argc, &argv); else oldsyntax(argc, &argv); diff --git a/usr.bin/hexdump/hexsyntax.c b/usr.bin/hexdump/hexsyntax.c index a1b2099..ac1971a 100644 --- a/usr.bin/hexdump/hexsyntax.c +++ b/usr.bin/hexdump/hexsyntax.c @@ -54,7 +54,7 @@ newsyntax(int argc, char ***argvp) char *p, **argv; argv = *argvp; - if ((p = rindex(argv[0], 'h')) != NULL && + if ((p = strrchr(argv[0], 'h')) != NULL && strcmp(p, "hd") == 0) { /* "Canonical" format, implies -C. */ add("\"%08.8_Ax\n\""); diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index b550bd6..0fa24f5 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -58,7 +58,7 @@ addfile(char *name) if ((fp = fopen(name, "r")) == NULL) err(1, "%s", name); while (fgets(buf, sizeof(buf), fp)) { - if (!(p = index(buf, '\n'))) { + if (!(p = strchr(buf, '\n'))) { warnx("line too long"); while ((ch = getchar()) != '\n' && ch != EOF); continue; @@ -167,7 +167,7 @@ size(FS *fs) * skip any special chars -- save precision in * case it's a %s format. */ - while (index(spec + 1, *++fmt)); + while (strchr(spec + 1, *++fmt)); if (*fmt == '.' && isdigit(*++fmt)) { prec = atoi(fmt); while (isdigit(*++fmt)); @@ -243,10 +243,10 @@ rewrite(FS *fs) if (fu->bcnt) { sokay = USEBCNT; /* Skip to conversion character. */ - for (++p1; index(spec, *p1); ++p1); + for (++p1; strchr(spec, *p1); ++p1); } else { /* Skip any special chars, field width. */ - while (index(spec + 1, *++p1)); + while (strchr(spec + 1, *++p1)); if (*p1 == '.' && isdigit(*++p1)) { sokay = USEPREC; prec = atoi(p1); |