- char *endptr;
- int save_errno = errno;
-
- errno = 0;
- *val = strtoll(str, &endptr, node->base);
-
- if ((errno == ERANGE && (*val == LLONG_MAX || *val == LLONG_MIN)) ||
- (errno != 0 && *val == 0))
- return -1;
-
- if (node->check_min && *val < node->min) {
- errno = ERANGE;
- return -1;
- }