[hackers] [ubase] Error out if there are multiple separators in sysctl || sin

From: <git_AT_suckless.org>
Date: Thu, 17 Apr 2014 18:05:16 +0200

commit 3985929b6dcd9f0d642a7e57d71b3e216afa7369
Author: sin <sin_AT_2f30.org>
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
_AT_@ -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 != '
Received on Thu Apr 17 2014 - 18:05:16 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 17 2014 - 18:12:14 CEST