=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tftp/main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/tftp/main.c 2002/02/16 21:27:55 1.10 --- src/usr.bin/tftp/main.c 2003/03/13 09:09:35 1.11 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.10 2002/02/16 21:27:55 millert Exp $ */ /* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: main.c,v 1.11 2003/03/13 09:09:35 deraadt Exp $ */ /* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: main.c,v 1.10 2002/02/16 21:27:55 millert Exp $"; #endif /* not lint */ /* Many bug fixes are from Jim Guyton */ --- 44,50 ---- #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: main.c,v 1.11 2003/03/13 09:09:35 deraadt Exp $"; #endif /* not lint */ /* Many bug fixes are from Jim Guyton */ *************** *** 172,178 **** s_in.sin_family = AF_INET; if (bind(f, (struct sockaddr *)&s_in, sizeof (s_in)) < 0) err(1, "tftp: bind"); ! strcpy(mode, "netascii"); signal(SIGINT, intr); if (argc > 1) { if (setjmp(toplevel) != 0) --- 172,178 ---- s_in.sin_family = AF_INET; if (bind(f, (struct sockaddr *)&s_in, sizeof (s_in)) < 0) err(1, "tftp: bind"); ! strlcpy(mode, "netascii", sizeof mode); signal(SIGINT, intr); if (argc > 1) { if (setjmp(toplevel) != 0) *************** *** 195,201 **** struct hostent *host; if (argc < 2) { ! strcpy(line, "Connect "); printf("(to) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) --- 195,201 ---- struct hostent *host; if (argc < 2) { ! strlcpy(line, "Connect ", sizeof line); printf("(to) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) *************** *** 220,226 **** } peeraddr.sin_family = host->h_addrtype; bcopy(host->h_addr, &peeraddr.sin_addr, host->h_length); ! (void) strcpy(hostname, host->h_name); } port = sp->s_port; if (argc == 3) { --- 220,226 ---- } peeraddr.sin_family = host->h_addrtype; bcopy(host->h_addr, &peeraddr.sin_addr, host->h_length); ! (void) strlcpy(hostname, host->h_name, sizeof hostname); } port = sp->s_port; if (argc == 3) { *************** *** 305,311 **** settftpmode(newmode) char *newmode; { ! strcpy(mode, newmode); if (verbose) printf("mode set to %s\n", mode); } --- 305,311 ---- settftpmode(newmode) char *newmode; { ! strlcpy(mode, newmode, sizeof mode); if (verbose) printf("mode set to %s\n", mode); } *************** *** 324,330 **** char *cp, *targ; if (argc < 2) { ! strcpy(line, "send "); printf("(file) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) --- 324,330 ---- char *cp, *targ; if (argc < 2) { ! strlcpy(line, "send ", sizeof line); printf("(file) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) *************** *** 357,363 **** bcopy(hp->h_addr, (caddr_t)&peeraddr.sin_addr, hp->h_length); peeraddr.sin_family = hp->h_addrtype; connected = 1; ! strcpy(hostname, hp->h_name); } if (!connected) { printf("No target machine specified.\n"); --- 357,363 ---- bcopy(hp->h_addr, (caddr_t)&peeraddr.sin_addr, hp->h_length); peeraddr.sin_family = hp->h_addrtype; connected = 1; ! strlcpy(hostname, hp->h_name, sizeof hostname); } if (!connected) { printf("No target machine specified.\n"); *************** *** 418,424 **** char *src; if (argc < 2) { ! strcpy(line, "get "); printf("(files) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) --- 418,424 ---- char *src; if (argc < 2) { ! strlcpy(line, "get ", sizeof line); printf("(files) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) *************** *** 454,460 **** hp->h_length); peeraddr.sin_family = hp->h_addrtype; connected = 1; ! strcpy(hostname, hp->h_name); } if (argc < 4) { cp = argc == 3 ? argv[2] : tail(src); --- 454,460 ---- hp->h_length); peeraddr.sin_family = hp->h_addrtype; connected = 1; ! strlcpy(hostname, hp->h_name, sizeof hostname); } if (argc < 4) { cp = argc == 3 ? argv[2] : tail(src); *************** *** 502,508 **** int t; if (argc < 2) { ! strcpy(line, "Rexmt-timeout "); printf("(value) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) --- 502,508 ---- int t; if (argc < 2) { ! strlcpy(line, "Rexmt-timeout ", sizeof line); printf("(value) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) *************** *** 531,537 **** int t; if (argc < 2) { ! strcpy(line, "Maximum-timeout "); printf("(value) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv()) --- 531,537 ---- int t; if (argc < 2) { ! strlcpy(line, "Maximum-timeout ", sizeof line); printf("(value) "); fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin); if (makeargv())