diff --git a/src/argparse.c b/src/argparse.c index 5d2cd6e..db8a246 100644 --- a/src/argparse.c +++ b/src/argparse.c @@ -1354,7 +1354,7 @@ int mm_arg_parse(const struct mm_arg_parser* parser, int argc, char* argv[]) return early_stop_parsing(parser, r); } - return index; + return index > argc ? argc : index; } /**