]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/opt.c
Opt: Fix bug introduced by my cleanups
[libucw.git] / ucw / opt.c
index 01c660389b5d01e6d4f9101153a4ddb68420de77..4cddc6214c890ca06388030e7b5281d21e39be00 100644 (file)
--- 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)