commit: c93299119462a20d45bf30096fe56f4687e09b1b
parent 420476103f931781b38ec029f12ff8356cce30a4
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 16 Dec 2024 23:02:46 +0100
cmd/{renice,nice}: move endptr declr outside of switch block
Diffstat:
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/cmd/nice.c b/cmd/nice.c
@@ -28,12 +28,12 @@ main(int argc, char *argv[])
int c = -1;
while((c = getopt(argc, argv, ":n:")) != -1)
{
+ char *endptr = NULL;
+
switch(c)
{
case 'n':
assert(errno == 0);
- char *endptr = NULL;
-
incr = strtol(optarg, &endptr, 10);
if(endptr && *endptr != 0) errno = EINVAL;
diff --git a/cmd/renice.c b/cmd/renice.c
@@ -75,6 +75,8 @@ main(int argc, char *argv[])
int c = -1;
while((c = getopt(argc, argv, ":gpun:")) != -1)
{
+ char *endptr = NULL;
+
switch(c)
{
case 'g':
@@ -88,7 +90,6 @@ main(int argc, char *argv[])
break;
case 'n':
assert(errno == 0);
- char *endptr = NULL;
adj = strtol(optarg, &endptr, 10);