mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-10-31 04:50:34 -04:00 
			
		
		
		
	Fail wsprd if data directory specified not accessible
Also fixed trivial memory leak on error exit.
This commit is contained in:
		
							parent
							
								
									3134dd8a60
								
							
						
					
					
						commit
						ac6a6d0cd7
					
				| @ -875,10 +875,12 @@ int main(int argc, char *argv[]) | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     if( stackdecoder ) { | ||||
|         stack=calloc(stacksize,sizeof(struct snode)); | ||||
|     if( access(data_dir, R_OK | W_OK)) { | ||||
|       fprintf(stderr, "Error: inaccessible data directory: '%s'\n", data_dir); | ||||
|       usage(); | ||||
|       return EXIT_FAILURE; | ||||
|     } | ||||
|      | ||||
| 
 | ||||
|     if( optind+1 > argc) { | ||||
|         usage(); | ||||
|         return 1; | ||||
| @ -886,6 +888,10 @@ int main(int argc, char *argv[]) | ||||
|         ptr_to_infile=argv[optind]; | ||||
|     } | ||||
|      | ||||
|     if( stackdecoder ) { | ||||
|         stack=calloc(stacksize,sizeof(struct snode)); | ||||
|     } | ||||
| 
 | ||||
|     // setup metric table
 | ||||
|     for(i=0; i<256; i++) { | ||||
|         mettab[0][i]=round( 10*(metric_tables[2][i]-bias) ); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user