ubase

suckless linux base utils
git clone git://git.2f30.org/ubase.git
Log | Files | Refs | README | LICENSE

commit 8d922011703ddbea689ee7dd6baaedeb4c6b2c02
parent 2618410910ce2c8dacdc418d3f8d96fc673d39b3
Author: sin <sin@2f30.org>
Date:   Fri Apr 18 09:30:48 +0100

variable cannot be NULL so don't test for that

Diffstat:
sysctl.c | 28+++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/sysctl.c b/sysctl.c @@ -154,23 +154,21 @@ main(int argc, char *argv[]) } variable = argv[i]; - if (variable) { - if (value) { - if (setsysctl(variable, value) < 0) { - r = EXIT_FAILURE; - weprintf("failed to set sysctl for %s\n", variable); - continue; - } + if (value) { + if (setsysctl(variable, value) < 0) { + r = EXIT_FAILURE; + weprintf("failed to set sysctl for %s\n", variable); + continue; } - else { - if (getsysctl(variable, &value) < 0) { - r = EXIT_FAILURE; - weprintf("failed to get sysctl for %s\n", variable); - continue; - } - printf("%s = %s\n", variable, value); - free(value); + } + else { + if (getsysctl(variable, &value) < 0) { + r = EXIT_FAILURE; + weprintf("failed to get sysctl for %s\n", variable); + continue; } + printf("%s = %s\n", variable, value); + free(value); } }