Fix overflowing on nul character.

PR:		bin/16926
MFC after:	1 week
This commit is contained in:
Mike Heffner 2001-05-28 03:49:23 +00:00
parent f83a4e8171
commit f332550d02

View File

@ -1062,7 +1062,7 @@ main(int argc, char *argv[])
/* Have now read in the data. Next get the message to be printed. */
if (*argv) {
for(i=0, j=0; i < argc; i++)
j += strlen(argv[i]) + (i != 0);
j += strlen(argv[i]) + 1;
if ((message = malloc((size_t)j)) == NULL)
err(1, "malloc");
strcpy(message, *argv);