Merge pull request #710 from d06alexandrov/ini_parse_fail_msg

Added more clear error message in case of failed config read.
This commit is contained in:
johnjiang 2022-11-04 12:02:41 +08:00 committed by GitHub
commit 5857f99fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -1045,7 +1045,16 @@ ff_load_config(int argc, char *const argv[])
ret = ini_parse(ff_global_cfg.filename, ini_parse_handler,
&ff_global_cfg);
if (ret != 0) {
printf("parse %s failed on line %d\n", ff_global_cfg.filename, ret);
switch(ret) {
case -1:
printf("failed to open file %s\n", ff_global_cfg.filename);
break;
case -2:
printf("failed to allocate memory for config parsing\n");
break;
default:
printf("parse %s failed on line %d\n", ff_global_cfg.filename, ret);
}
return -1;
}