diff options
author | Hans Insulander <hin@cvs.openbsd.org> | 2003-04-03 12:05:59 +0000 |
---|---|---|
committer | Hans Insulander <hin@cvs.openbsd.org> | 2003-04-03 12:05:59 +0000 |
commit | 448414f170f311452f7117c6fdee8addb9964a55 (patch) | |
tree | 5985aafeee6c66fd128fbae71c50424316ebdc06 /usr.bin/telnet/commands.c | |
parent | 7bf1f7730951cca007e18a5cb600dbfd7418da34 (diff) |
strcpy -> strlcpy
strcat -> strlcat
ok millert@
Diffstat (limited to 'usr.bin/telnet/commands.c')
-rw-r--r-- | usr.bin/telnet/commands.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index 2e189523064..55d5755224a 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commands.c,v 1.42 2002/06/12 06:07:16 mpech Exp $ */ +/* $OpenBSD: commands.c,v 1.43 2003/04/03 12:05:58 hin Exp $ */ /* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */ /* @@ -101,7 +101,7 @@ makeargv() margc = 0; cp = line; if (*cp == '!') { /* Special case shell escape */ - strcpy(saveline, line); /* save for shell command */ + strlcpy(saveline, line, sizeof(saveline)); /* save for shell command */ *argp++ = "!"; /* No room in string to get this */ margc++; cp++; @@ -2293,7 +2293,7 @@ tn(argc, argv) return 0; } if (argc < 2) { - (void) strcpy(line, "open "); + strlcpy(line, "open ", sizeof(line)); printf("(to) "); (void) fgets(&line[strlen(line)], sizeof(line) - strlen(line), stdin); makeargv(); @@ -2397,7 +2397,7 @@ tn(argc, argv) if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), NULL, 0, niflags) != 0) { - strcpy(hbuf, "(invalid)"); + strlcpy(hbuf, "(invalid)", sizeof(hbuf)); } printf("Trying %s...\r\n", hbuf); } @@ -2457,7 +2457,7 @@ tn(argc, argv) if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), NULL, 0, niflags) != 0) { - strcpy(hbuf, "(invalid)"); + strlcpy(hbuf, "(invalid)", sizeof(hbuf)); } fprintf(stderr, "telnet: connect to address %s: %s\n", hbuf, strerror(errno)); |