mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-15 20:28:40 -04:00
Fail wsprd if data directory specified not accessible
Also fixed trivial memory leak on error exit.
This commit is contained in:
+9
-3
@@ -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) );
|
||||
|
||||
Reference in New Issue
Block a user