diff options
author | pommicket <pommicket@gmail.com> | 2025-09-14 01:26:00 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-14 01:26:00 -0400 |
commit | 0e220eaa56d5b1947e6bead8e5695446ab102fba (patch) | |
tree | 2777f5010c10bdf71bbb38d87eb4f8b8deb35b42 /examples | |
parent | 1ed5d20169194631b3da49982df82774fcba7cb7 (diff) |
simplify error-to-string interface
Diffstat (limited to 'examples')
-rw-r--r-- | examples/conf.pom | 4 | ||||
-rw-r--r-- | examples/read_conf.c | 7 |
2 files changed, 3 insertions, 8 deletions
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; } |