mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 00:50:40 +01:00
* leave GetFileContents() early if the file size is 0 to avoid a range error if the RTL is compiled with range checks
This commit is contained in:
parent
be117b33d3
commit
9fccadc1f0
@ -866,6 +866,8 @@ begin
|
||||
if FileSeek(aHandle,0,fsFromBeginning)<0 then
|
||||
Raise EInOutError.Create(SSeekFailed);
|
||||
SetLength(Result,aLen);
|
||||
if aLen=0 then
|
||||
Exit;
|
||||
aOffset:=0;
|
||||
Repeat
|
||||
aBuf:=@Result[aOffset];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user