Fix the number of bytes allocated by realloc when more space is needed

for the vector of arguments.

MFC after:	1 week
This commit is contained in:
ghelmer 2001-06-07 20:05:18 +00:00
parent b009fce00b
commit e1e754c0ab

View File

@ -1765,7 +1765,7 @@ addarg(argv, val)
if (cpp == &argv[(long)argv[-1]]) {
--argv;
*argv = (char *)((long)(*argv) + 10);
argv = (char **)realloc(argv, (long)(*argv) + 2);
argv = (char **)realloc(argv, sizeof(*argv) * ((long)(*argv) + 2));
if (argv == NULL)
return(NULL);
argv++;