mirror of
				https://github.com/cclassic/model-ghdl
				synced 2025-11-04 02:49:33 +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:
		
							
								
								
									
										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]);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user