Report diagnostics from libconfig when parsing fails.

This commit is contained in:
Pavel Machek
2024-04-24 13:50:06 +02:00
parent bd1ea477f8
commit 9d13caa464

View File

@@ -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;
}