mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 17:11:08 +02:00
* allow a range of Low(Longint) to High(DWord) in TryStrToInt, see also issue #39406
* moved test
(cherry picked from commit 435f3a9fe2
)
This commit is contained in:
parent
3828c73678
commit
bbffe9e26a
@ -962,7 +962,7 @@ var
|
|||||||
li : Int64;
|
li : Int64;
|
||||||
begin
|
begin
|
||||||
Val(s, li, Error);
|
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
|
if TryStrToInt then
|
||||||
i:=li;
|
i:=li;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user