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

Prompted by:	dd
MFC after:	2 weeks
This commit is contained in:
sobomax 2001-10-15 18:21:08 +00:00
parent 5d13f1960f
commit 8d45c05687
2 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ main(int argc, char **argv)
break;
case 't':
strcpy(PlayPen, optarg);
strncpy(PlayPen, optarg, sizeof(PlayPen));
break;
case 'X':

View File

@ -147,7 +147,7 @@ main(int argc, char **argv)
break;
case 't':
strcpy(PlayPen, optarg);
strncpy(PlayPen, optarg, sizeof(PlayPen));
break;
case 'x':