From 3a3c1759297d3621663571dc85d2fb5d1d53b3b1 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Wed, 5 Oct 2016 10:24:59 +0200 Subject: Avoid fatal error handling in option parsers. * trans/crash.c (parse_opt): Avoid 'error' in favor of the appropriate argp error reporting mechanism. * trans/remap.c (parse_opt): Likewise. * utils/msgids.c (parse_opt): Likewise. --- trans/crash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'trans/crash.c') diff --git a/trans/crash.c b/trans/crash.c index 14783cf8..3c244515 100644 --- a/trans/crash.c +++ b/trans/crash.c @@ -640,7 +640,10 @@ parse_opt (int opt, char *arg, struct argp_state *state) { char *errp; if (! template_valid (arg, &errp)) - error (1, 0, "Invalid template: ...'%s'", errp); + { + argp_error (state, "Invalid template: ...'%s'", errp); + return EINVAL; + } } corefile_template = arg; break; -- cgit v1.2.3