This is how our other try_parse() implementions behave.
}
if (int.MIN <= long_result <= int.MAX) {
result = (int) long_result;
- return errno != ERANGE && errno != EINVAL;
+ return errno != ERANGE && errno != EINVAL && unparsed != endptr;
} else {
result = int.MAX;
return false;
}
if (uint.MIN <= ulong_result <= uint.MAX) {
result = (uint) ulong_result;
- return errno != ERANGE && errno != EINVAL;
+ return errno != ERANGE && errno != EINVAL && unparsed != endptr;
} else {
result = uint.MAX;
return false;