From dd2a113f5fdc4ff611e57dff1b75555668cb451f Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Sun, 7 Dec 2025 15:06:24 -0800 Subject: [PATCH] maint: nproc: reduce variable scope * src/nproc.c (main): Declare variables where they are used instead of at the start of the function. --- src/nproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.3