aboutsummaryrefslogtreecommitdiff
path: root/sbin/sysctl
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-09-25 22:47:19 +0000
committerXin LI <delphij@FreeBSD.org>2014-09-25 22:47:19 +0000
commit4b8740cd0af0f2177bae523857ee5ce65071e9a9 (patch)
treea43c374a05ea5a975bff89c8ee7d3bd42c21216a /sbin/sysctl
parent9e4ed37219b552bbf01b793f758d87afc2f6593e (diff)
Notes
Diffstat (limited to 'sbin/sysctl')
-rw-r--r--sbin/sysctl/sysctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index d7fe8e91356f3..5ebec28c18a27 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -294,6 +294,8 @@ parse(const char *string, int lineno)
}
}
+ errno = 0;
+
switch (kind & CTLTYPE) {
case CTLTYPE_INT:
if (strcmp(fmt, "IK") == 0) {
@@ -673,6 +675,7 @@ set_IK(const char *str, int *val)
if ((len = strlen(str)) == 0)
return (0);
p = &str[len - 1];
+ errno = 0;
if (*p == 'C' || *p == 'F') {
temp = strtof(str, &endptr);
if (errno != 0 || endptr == str ||