summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-01-14 14:05:02 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2020-01-14 14:06:23 +0100
commit8021ad3876ede6b19a8e075ab0f0a23a999d0b50 (patch)
tree2979b85d6d6235453dcb78d0f03c002864dc2452
parent8dd348ce50260c37fb103f21c5956b7ce63cc2f0 (diff)
downloadvala-8021ad3876ede6b19a8e075ab0f0a23a999d0b50.tar.gz
glib-2.0: Let (u)int.try_parse() return false if there is an unparsed part
This is how our other try_parse() implementions behave.
-rw-r--r--vapi/glib-2.0.vapi4
1 files changed, 2 insertions, 2 deletions
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index e4ce4dcd6..255f0834a 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -164,7 +164,7 @@ public struct int {
}
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;
@@ -225,7 +225,7 @@ public struct uint {
}
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;