This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=809c0f9920da9f3890e8c7ac7a78fe6ad053d129 commit 809c0f9920da9f3890e8c7ac7a78fe6ad053d129 Author: Guillem Jover <[email protected]> AuthorDate: Tue Feb 14 02:05:19 2023 +0100 libcompat: Reduce variables scope Warned-by: cppcheck --- lib/compat/getopt.c | 2 +- lib/compat/getopt1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compat/getopt.c b/lib/compat/getopt.c index f28154398..46875a166 100644 --- a/lib/compat/getopt.c +++ b/lib/compat/getopt.c @@ -988,12 +988,12 @@ main (argc, argv) int argc; char **argv; { - int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; + int c; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) diff --git a/lib/compat/getopt1.c b/lib/compat/getopt1.c index b51be7f1b..e0bc52881 100644 --- a/lib/compat/getopt1.c +++ b/lib/compat/getopt1.c @@ -105,7 +105,6 @@ main (argc, argv) int argc; char **argv; { - int c; int digit_optind = 0; while (1) @@ -122,6 +121,7 @@ main (argc, argv) {"file", 1, 0, 0}, {0, 0, 0, 0} }; + int c; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); -- Dpkg.Org's dpkg

