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:
Maxim Sobolev 2001-10-15 18:21:08 +00:00
parent ae2bac960e
commit be5780f384
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':