From 7bc8ac0c35016012bb1e28dd465e550f0be4febe Mon Sep 17 00:00:00 2001 From: Michael Black Date: Thu, 19 Dec 2019 08:14:26 -0600 Subject: [PATCH] Fix cppcheck warning in getopt_long.c --- lib/getopt_long.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/getopt_long.c b/lib/getopt_long.c index 19491fafb..e42782f27 100644 --- a/lib/getopt_long.c +++ b/lib/getopt_long.c @@ -91,11 +91,11 @@ main(argc, argv) int argc; char **argv; { - int c; - int digit_optind = 0; - while (1) { + int c; + int digit_optind = 0; + int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] =