From 3d98d3862c1d42cf2da00f34ad82e1a06a72962e Mon Sep 17 00:00:00 2001 From: Michael Black Date: Thu, 19 Dec 2019 08:13:34 -0600 Subject: [PATCH] Fix cppcheck warning in getopt.c --- lib/getopt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/getopt.c b/lib/getopt.c index b448525dd..33d313897 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -721,11 +721,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; c = getopt(argc, argv, "abc:d:0123456789");