mirror of
https://github.com/cclassic/model-ghdl
synced 2024-11-23 08:45:04 +01:00
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.
This commit is contained in:
parent
ef6c65d20d
commit
55bf73e52d
7
main.c
7
main.c
@ -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(¶ms, 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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user