From: Martin Mares Date: Mon, 27 Jan 2014 16:03:19 +0000 (+0100) Subject: Opt: Fix bug introduced by my cleanups X-Git-Tag: v5.99~25^2~14 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0e17ad98def5abb90b274921fb57a35ee980b564;p=libucw.git Opt: Fix bug introduced by my cleanups --- diff --git a/ucw/opt.c b/ucw/opt.c index 01c66038..4cddc621 100644 --- a/ucw/opt.c +++ b/ucw/opt.c @@ -514,7 +514,7 @@ static void opt_check_required(struct opt_context *oc) if (!opt->count && (opt->flags & OPT_REQUIRED)) { struct opt_item *item = opt->item; if (item->letter > OPT_POSITIONAL_TAIL) - opt_failure("Required positional argument #%d not found.", i - OPT_POSITIONAL_TAIL); + opt_failure("Required positional argument #%d not found.", item->letter - OPT_POSITIONAL_TAIL); else if (item->letter == OPT_POSITIONAL_TAIL) opt_failure("Required positional argument not found."); else if (item->letter && item->name)