Use strlcpy(3) instead of strcpy(3) to copy optarg into a fixed-size buffer.

MFC after:	2 weeks
This commit is contained in:
Maxim Sobolev 2001-10-16 09:21:09 +00:00
parent db92bfc1b4
commit de853a38b8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85026
3 changed files with 3 additions and 3 deletions

View File

@ -242,7 +242,7 @@ main(ac, av)
break;
case 'I':
strcpy(map_name, optarg);
strlcpy(map_name, optarg, sizeof(map_name));
break;
default:

View File

@ -251,8 +251,8 @@ main(argc, argv)
break;
case 't':
#if defined(TN3270) && defined(unix)
(void)strlcpy(tline, optarg, sizeof(tline));
transcom = tline;
(void)strcpy(transcom, optarg);
#else
fprintf(stderr,
"%s: Warning: -t ignored, no TN3270 support.\n",

View File

@ -168,7 +168,7 @@ main(int argc, char **argv)
break;
case 'L':
strcpy(logfile, optarg);
strlcpy(logfile, optarg, sizeof(logfile));
break;
case 'P':