From: Collin Funk Date: Sun, 7 Dec 2025 23:06:24 +0000 (-0800) Subject: maint: nproc: reduce variable scope X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd2a113f5fdc4ff611e57dff1b75555668cb451f;p=thirdparty%2Fcoreutils.git maint: nproc: reduce variable scope * src/nproc.c (main): Declare variables where they are used instead of at the start of the function. --- diff --git a/src/nproc.c b/src/nproc.c index ec196297a4..795458aa01 100644 --- a/src/nproc.c +++ b/src/nproc.c @@ -74,7 +74,7 @@ which may be less than the number of online processors\n\ int main (int argc, char **argv) { - unsigned long nproc, ignore = 0; + unsigned long ignore = 0; initialize_main (&argc, &argv); set_program_name (argv[0]); setlocale (LC_ALL, ""); @@ -116,7 +116,7 @@ main (int argc, char **argv) usage (EXIT_FAILURE); } - nproc = num_processors (mode); + unsigned long nproc = num_processors (mode); if (ignore < nproc) nproc -= ignore;