mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 04:11:16 -05: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,8 +875,10 @@ 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) {
|
||||
@ -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…
Reference in New Issue
Block a user