From 8021ad3876ede6b19a8e075ab0f0a23a999d0b50 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 14 Jan 2020 14:05:02 +0100 Subject: [PATCH] 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; -- 2.47.2