From 0e220eaa56d5b1947e6bead8e5695446ab102fba Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 14 Sep 2025 01:26:00 -0400 Subject: simplify error-to-string interface --- examples/conf.pom | 4 ++-- examples/read_conf.c | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/conf.pom b/examples/conf.pom index 0edc83f..ed37ed9 100644 --- a/examples/conf.pom +++ b/examples/conf.pom @@ -1,7 +1,7 @@ -[number] +[number]p one = 1 two = 2x"\? -three = "3 +three j= "3 is the best" diff --git a/examples/read_conf.c b/examples/read_conf.c index 54a1e86..18802e3 100644 --- a/examples/read_conf.c +++ b/examples/read_conf.c @@ -8,12 +8,7 @@ int main(int argc, char **argv) { pom_error *error; pom_conf *conf = pom_load_path(argc >= 2 ? argv[1] : "conf.pom", &error); if (!conf) { - char *string = pom_error_to_string(error); - for (char *s=string; *s; s++) - if (*s >= 'a' && *s <= 'z') - *s += 'A' - 'a'; - printf("%s\n",string); - free(string); + pom_error_print(error); free(error); return EXIT_FAILURE; } -- cgit v1.2.3