[hackers] [ubase] variable cannot be NULL so don't test for that || sin
commit 8d922011703ddbea689ee7dd6baaedeb4c6b2c02
Author: sin <sin_AT_2f30.org>
Date: Fri Apr 18 09:30:48 2014 +0100
variable cannot be NULL so don't test for that
diff --git a/sysctl.c b/sysctl.c
index d26f9d06..e4e75ec 100644
--- a/sysctl.c
+++ b/sysctl.c
_AT_@ -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
", variable);
- continue;
- }
+ if (value) {
+ if (setsysctl(variable, value) < 0) {
+ r = EXIT_FAILURE;
+ weprintf("failed to set sysctl for %s
", variable);
+ continue;
}
- else {
- if (getsysctl(variable, &value) < 0) {
- r = EXIT_FAILURE;
- weprintf("failed to get sysctl for %s
", variable);
- continue;
- }
- printf("%s = %s
", variable, value);
- free(value);
+ }
+ else {
+ if (getsysctl(variable, &value) < 0) {
+ r = EXIT_FAILURE;
+ weprintf("failed to get sysctl for %s
", variable);
+ continue;
}
+ printf("%s = %s
", variable, value);
+ free(value);
}
}
Received on Fri Apr 18 2014 - 10:31:43 CEST
This archive was generated by hypermail 2.3.0
: Fri Apr 18 2014 - 10:36:14 CEST