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:
parent
b009fce00b
commit
e1e754c0ab
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user