From c96c3c4c8373d56bcbc2cd8a27bca79f19b98496 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Wed, 1 Jun 2022 18:23:04 +0200 Subject: [PATCH] Fix config file error messages --- src/configfile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index 62220ae..b41905a 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -56,7 +56,7 @@ static int get_match(const char *input, const char *pattern, char **match) if (ret) { regerror(ret, &re, err, sizeof(err)); - printf("reg error: %s\n", err); + error_printf("regex error: %s", err); return ret; } @@ -264,7 +264,7 @@ void config_file_parse(const int argc, char *argv[]) ret = ini_parse(c->path, data_handler, NULL); if (ret < 0) { - fprintf(stderr, "Error: unable to parse configuration file (%d)\n", ret); + error_printf("Unable to parse configuration file (%d)", ret); exit(EXIT_FAILURE); } c->section_name = NULL; @@ -276,7 +276,7 @@ void config_file_parse(const int argc, char *argv[]) ret = ini_parse(c->path, section_name_search_handler, NULL); if (!c->section_name) { - debug_printf("unable to match user input to configuration section (%d)\n", ret); + debug_printf("Unable to match user input to configuration section (%d)", ret); return; } } @@ -285,7 +285,7 @@ void config_file_parse(const int argc, char *argv[]) ret = ini_parse(c->path, data_handler, NULL); if (ret < 0) { - fprintf(stderr, "Error: unable to parse configuration file (%d)\n", ret); + error_printf("Unable to parse configuration file (%d)", ret); exit(EXIT_FAILURE); } }