diff options
Diffstat (limited to 'usr.bin/tftp/main.c')
-rw-r--r-- | usr.bin/tftp/main.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c index 1c484c0fd45..b70dfde2a98 100644 --- a/usr.bin/tftp/main.c +++ b/usr.bin/tftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.3 1996/08/16 23:31:00 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.4 1997/01/17 07:13:30 millert Exp $ */ /* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: main.c,v 1.3 1996/08/16 23:31:00 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.4 1997/01/17 07:13:30 millert Exp $"; #endif /* not lint */ /* Many bug fixes are from Jim Guyton <guyton@rand-unix> */ @@ -152,8 +152,6 @@ struct cmd cmdtab[] = { struct cmd *getcmd(); char *tail(); -char *index(); -char *rindex(); int main(argc, argv) @@ -340,17 +338,17 @@ put(argc, argv) return; } targ = argv[argc - 1]; - if (index(argv[argc - 1], ':')) { + if (strchr(argv[argc - 1], ':')) { char *cp; struct hostent *hp; for (n = 1; n < argc - 1; n++) - if (index(argv[n], ':')) { + if (strchr(argv[n], ':')) { putusage(argv[0]); return; } cp = argv[argc - 1]; - targ = index(cp, ':'); + targ = strchr(cp, ':'); *targ++ = 0; hp = gethostbyname(cp); if (hp == NULL) { @@ -383,7 +381,7 @@ put(argc, argv) } /* this assumes the target is a directory */ /* on a remote unix system. hmmmm. */ - cp = index(targ, '\0'); + cp = strchr(targ, '\0'); *cp++ = '/'; for (n = 1; n < argc - 1; n++) { strcpy(cp, tail(argv[n])); @@ -435,13 +433,13 @@ get(argc, argv) } if (!connected) { for (n = 1; n < argc ; n++) - if (index(argv[n], ':') == 0) { + if (strchr(argv[n], ':') == 0) { getusage(argv[0]); return; } } for (n = 1; n < argc ; n++) { - src = index(argv[n], ':'); + src = strchr(argv[n], ':'); if (src == NULL) src = argv[n]; else { @@ -583,7 +581,7 @@ tail(filename) register char *s; while (*filename) { - s = rindex(filename, '/'); + s = strrchr(filename, '/'); if (s == NULL) break; if (s[1]) |