diff --git a/bootstrap.conf b/bootstrap.conf index b51e08a..a3ae473 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -32,6 +32,7 @@ gnulib_modules=" langinfo netinet_in progname + quote realloc-gnu stat stddef diff --git a/src/dhcpd-pools.c b/src/dhcpd-pools.c index 46447e3..d7f57f0 100644 --- a/src/dhcpd-pools.c +++ b/src/dhcpd-pools.c @@ -49,6 +49,7 @@ #include "closeout.h" #include "error.h" #include "progname.h" +#include "quote.h" #include "xalloc.h" #include "dhcpd-pools.h" @@ -81,7 +82,7 @@ static int return_limit(const char c) if ('0' <= c && c < '8') return c - '0'; clean_up(); - error(EXIT_FAILURE, 0, "return_limit: output mask '%s' is illegal", optarg); + error(EXIT_FAILURE, 0, "return_limit: output mask %s is illegal", quote(optarg)); return 0; } @@ -241,7 +242,7 @@ int main(int argc, char **argv) /* Print help */ usage(EXIT_SUCCESS); default: - error(EXIT_FAILURE, 0, "Try `%s --help' for more information.", + error(EXIT_FAILURE, 0, "Try %s --help for more information.", program_name); } } @@ -284,7 +285,7 @@ int main(int argc, char **argv) break; default: clean_up(); - error(EXIT_FAILURE, 0, "main: unknown output format '%c'", print_mac_addreses_tmp[0]); + error(EXIT_FAILURE, 0, "unknown output format: %s", quote(print_mac_addreses_tmp)); } /* Do the job */ set_ipv_functions(IPvUNKNOWN); diff --git a/src/other.c b/src/other.c index a61c460..cd2cb3a 100644 --- a/src/other.c +++ b/src/other.c @@ -51,6 +51,7 @@ #include "error.h" #include "progname.h" +#include "quote.h" #include "dhcpd-pools.h" #include "defaults.h" @@ -378,7 +379,7 @@ double strtod_or_err(const char *restrict str, const char *restrict errmesg) goto err; return num; err: - error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str); + error(EXIT_FAILURE, errno, "%s: %s", errmesg, quote(str)); return 0; } diff --git a/src/sort.c b/src/sort.c index 266362d..0bc9a5b 100644 --- a/src/sort.c +++ b/src/sort.c @@ -46,6 +46,7 @@ #include "error.h" #include "progname.h" +#include "quote.h" #include "dhcpd-pools.h" @@ -236,8 +237,11 @@ comparer_t field_selector(char c) case 'e': return comp_tcperc; default: - clean_up(); - error(EXIT_FAILURE, 0, "field_selector: unknown sort order `%c'", c); + { + char str[2] = { c, '\0' }; + clean_up(); + error(EXIT_FAILURE, 0, "field_selector: unknown sort order: %s", quote(str)); + } } return NULL; }