[vala/staging] glib-2.0: Let (u)int.try_parse() return false if there is an unparsed part
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] glib-2.0: Let (u)int.try_parse() return false if there is an unparsed part
- Date: Tue, 14 Jan 2020 13:15:28 +0000 (UTC)
commit 8021ad3876ede6b19a8e075ab0f0a23a999d0b50
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Jan 14 14:05:02 2020 +0100
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.
vapi/glib-2.0.vapi | 4 ++--
1 file 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]