diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-07-29 15:40:31 +0200 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-07-29 18:57:03 +0200 |
commit | b76ffdcce297ef55330839ddfe3053163e3b9abb (patch) | |
tree | 59ef02b5dc7423511e45334132100a483e411ad6 | |
parent | 54e8b9b96e4553b4a05e95612d0a91677e85f9e8 (diff) | |
download | gobject-introspection-b76ffdcce297ef55330839ddfe3053163e3b9abb.tar.gz |
g-ir-generate: fix missing error handling for command line parsing
The error arg was used but the result never checked.
-rw-r--r-- | tools/generate.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/generate.c b/tools/generate.c index 926ffcac..f35893c3 100644 --- a/tools/generate.c +++ b/tools/generate.c @@ -60,7 +60,12 @@ main (int argc, char *argv[]) context = g_option_context_new (""); g_option_context_add_main_entries (context, options, NULL); - g_option_context_parse (context, &argc, &argv, &error); + if (!g_option_context_parse (context, &argc, &argv, &error)) + { + g_fprintf (stderr, "failed to parse: %s\n", error->message); + g_error_free (error); + return 1; + } if (!input) { |