summaryrefslogtreecommitdiff
path: root/usr.bin/tftp
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tftp')
-rw-r--r--usr.bin/tftp/main.c20
-rw-r--r--usr.bin/tftp/tftp.c7
2 files changed, 12 insertions, 15 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])
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index d813f9bc55b..faa33f7f892 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftp.c,v 1.2 1996/06/26 05:40:35 deraadt Exp $ */
+/* $OpenBSD: tftp.c,v 1.3 1997/01/17 07:13:32 millert Exp $ */
/* $NetBSD: tftp.c,v 1.5 1995/04/29 05:55:25 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tftp.c,v 1.2 1996/06/26 05:40:35 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tftp.c,v 1.3 1997/01/17 07:13:32 millert Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -383,7 +383,6 @@ tpacket(s, tp, n)
{ "#0", "RRQ", "WRQ", "DATA", "ACK", "ERROR" };
register char *cp, *file;
u_short op = ntohs(tp->th_opcode);
- char *index();
if (op < RRQ || op > ERROR)
printf("%s opcode=%x ", s, op);
@@ -395,7 +394,7 @@ tpacket(s, tp, n)
case WRQ:
n -= 2;
file = cp = tp->th_stuff;
- cp = index(cp, '\0');
+ cp = strchr(cp, '\0');
printf("<file=%s, mode=%s>\n", file, cp + 1);
break;