From e8a28f5f8b3adedf26cdab70f22538719fabb7f1 Mon Sep 17 00:00:00 2001 From: Klaus Kämpf Date: Thu, 8 Nov 2012 15:57:36 +0100 Subject: Evaluate return value from u_option_context_parse() --- src/wsman.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/wsman.c') diff --git a/src/wsman.c b/src/wsman.c index 0b4de46..a73697b 100644 --- a/src/wsman.c +++ b/src/wsman.c @@ -359,11 +359,16 @@ static char wsman_parse_options(int argc, char **argv) retval = u_option_context_parse(opt_ctx, &argc, &argv, &error); u_option_context_free(opt_ctx); - if (error) { + if (retval == 0) { + if (error) { if (error->message) - printf("%s\n", error->message); + fprintf(stderr, "%s\n", error->message); u_error_free(error); - return FALSE; + } + else { + fprintf(stderr, "Can't parse context information\n"); + } + return FALSE; } if (my_version) { -- cgit