Call xmalloc before realloc
This commit is contained in:
parent
43626d7671
commit
d81891a2e6
@ -50,6 +50,7 @@ int xargs_main(int argc, char **argv)
|
||||
/* concatenate all the arguments passed to xargs together */
|
||||
int i;
|
||||
int len = 1; /* for the '\0' */
|
||||
cmd_to_be_executed = xmalloc(80);
|
||||
for (i = 1; i < argc; i++) {
|
||||
len += strlen(argv[i]);
|
||||
len += 1; /* for the space between the args */
|
||||
|
Loading…
Reference in New Issue
Block a user