commit 3985929b6dcd9f0d642a7e57d71b3e216afa7369
Author: sin <[email protected]>
Date: Thu Apr 17 17:01:57 2014 +0100
Error out if there are multiple separators in sysctl
diff --git a/sysctl.c b/sysctl.c
index 6a764e5..159180a 100644
--- a/sysctl.c
+++ b/sysctl.c
@@ -131,17 +131,27 @@ main(int argc, char *argv[])
usage();
for (i = 0; i < argc; i++) {
- value = NULL;
- variable = argv[i];
- p = strchr(variable, '=');
+ for (p = argv[i]; *p; p++) {
+ if (p[0] == '.' && p[1] == '.') {
+ weprintf("malformed input: %s
", argv[i]);
+ break;
+ }
+ }
+ if (*p != '