mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
Explicitly set errno to 0 before calling strto*.
Suggested by: mjg MFC after: 2 weeks
This commit is contained in:
parent
9e4ed37219
commit
4b8740cd0a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272145
@ -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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user