From: Rico Tzschichholz Date: Tue, 14 Jan 2020 13:05:02 +0000 (+0100) Subject: glib-2.0: Let (u)int.try_parse() return false if there is an unparsed part X-Git-Tag: 0.47.3~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8021ad3876ede6b19a8e075ab0f0a23a999d0b50;p=thirdparty%2Fvala.git 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. --- 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;