Use append_string for files

The old "manual" method missed zeroing the string before
the first use, thus creating random garbage before the
file names.
master
Markus Koch 2018-01-21 14:14:47 +01:00
parent ef6c65d20d
commit 55bf73e52d
1 changed files with 2 additions and 5 deletions

7
main.c
View File

@ -400,7 +400,6 @@ int vsim(int argc, char **argv)
int vcom(int argc, char **argv)
{
int i;
int slen = 0;
char workdir[1 K];
char *params = NULL;
char *work = NULL;
@ -449,10 +448,8 @@ int vcom(int argc, char **argv)
append_string(&params, argv[i]);
}
else if (argv[i][0] != '-'){ // VHDL file
slen += strlen(argv[i]) + 2;
files = realloc(files, slen * sizeof(char));
strcat(files, " ");
strcat(files, argv[i]);
append_string(&files, " ");
append_string(&files, argv[i]);
}
}