Report diagnostics from libconfig when parsing fails.
This commit is contained in:
@@ -403,6 +403,8 @@ libmegapixels_load_file(libmegapixels_devconfig *config, const char *file)
|
||||
config_init(&cfg);
|
||||
if (!config_read_file(&cfg, file)) {
|
||||
fprintf(stderr, "Could not read %s\n", file);
|
||||
fprintf(stderr, "%s:%d - %s\n",
|
||||
config_error_file(&cfg), config_error_line(&cfg), config_error_text(&cfg));
|
||||
config_destroy(&cfg);
|
||||
return 0;
|
||||
}
|
||||
@@ -571,4 +573,4 @@ libmegapixels_init(libmegapixels_devconfig **config)
|
||||
*config = calloc(1, sizeof(libmegapixels_devconfig));
|
||||
init_log(0);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user