aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-10-07 08:56:01 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-10-07 08:56:01 +0000
commitca587fdaacefd37fa5c2efd4766931897b8a831a (patch)
tree82d21966105ec00808cc7a5b2e2c8853d8142600 /sbin
parent023d10cbc7bffdf97c8e62260b467e34502eacc8 (diff)
Notes
Diffstat (limited to 'sbin')
-rw-r--r--sbin/sysctl/sysctl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index d740778cf0c8..8d67644a65ee 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -262,6 +262,12 @@ parse(const char *string, int lineno)
newvalstr = cp;
newsize = strlen(cp);
}
+ /* Trim spaces */
+ cp = bufp + strlen(bufp) - 1;
+ while (cp >= bufp && isspace((int)*cp)) {
+ *cp = '\0';
+ cp--;
+ }
len = name2oid(bufp, mib);
if (len < 0) {