From 435f3a9fe2ff52fb4f3c49dce72d34798fa40121 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 2 Jan 2022 21:33:01 +0100 Subject: [PATCH] * allow a range of Low(Longint) to High(DWord) in TryStrToInt, see also issue #39406 * moved test --- rtl/objpas/sysutils/sysstr.inc | 2 +- tests/{webtbs/tw8177.pp => test/units/sysutils/tstrtoint.pp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/{webtbs/tw8177.pp => test/units/sysutils/tstrtoint.pp} (100%) diff --git a/rtl/objpas/sysutils/sysstr.inc b/rtl/objpas/sysutils/sysstr.inc index 39e29a8b63..7ed0396587 100644 --- a/rtl/objpas/sysutils/sysstr.inc +++ b/rtl/objpas/sysutils/sysstr.inc @@ -963,7 +963,7 @@ var li : Int64; begin Val(s, li, Error); - TryStrToInt:=(Error=0) and (li<=High(Longint)) and (li>=Low(Longint)); + TryStrToInt:=(Error=0) and (li<=High(DWord)) and (li>=Low(Longint)); if TryStrToInt then i:=li; end; diff --git a/tests/webtbs/tw8177.pp b/tests/test/units/sysutils/tstrtoint.pp similarity index 100% rename from tests/webtbs/tw8177.pp rename to tests/test/units/sysutils/tstrtoint.pp