mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 00:33:57 +00:00
Use strlcpy(3) instead of strcpy(3) to copy optarg into a fixed-size buffer.
MFC after: 2 weeks
This commit is contained in:
parent
db92bfc1b4
commit
de853a38b8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85026
|
@ -242,7 +242,7 @@ main(ac, av)
|
|||
break;
|
||||
|
||||
case 'I':
|
||||
strcpy(map_name, optarg);
|
||||
strlcpy(map_name, optarg, sizeof(map_name));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -168,7 +168,7 @@ main(int argc, char **argv)
|
|||
break;
|
||||
|
||||
case 'L':
|
||||
strcpy(logfile, optarg);
|
||||
strlcpy(logfile, optarg, sizeof(logfile));
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
|
|
Loading…
Reference in a new issue