From c387170f903a976922de970042f8fdb6ec93a0f8 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Mon, 22 Oct 2018 19:12:14 +0200 Subject: Fix warning message handling Warning messages were not printed and handled properly, the patch fixes the issue. --- lib/args.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/args.c') diff --git a/lib/args.c b/lib/args.c index 5376ed0..f932719 100644 --- a/lib/args.c +++ b/lib/args.c @@ -278,8 +278,20 @@ static const struct ipset_arg ipset_args[] = { }, }; -const struct ipset_arg * ipset_keyword(enum ipset_keywords i) +const struct ipset_arg * +ipset_keyword(enum ipset_keywords i) { return (i > IPSET_ARG_NONE && i < IPSET_ARG_MAX) ? &ipset_args[i] : NULL; } + +const char * +ipset_ignored_optname(int opt) +{ + enum ipset_keywords i; + + for (i = IPSET_ARG_NONE + 1 ; i < IPSET_ARG_MAX; i++) + if (ipset_args[i].opt == opt) + return ipset_args[i].name[0]; + return ""; +} -- cgit v1.2.3