* Fix bug ID #37118

git-svn-id: trunk@45444 -
This commit is contained in:
michael 2020-05-20 07:32:09 +00:00
parent 18fdc0675e
commit 74e65f77bc

View File

@ -1243,7 +1243,10 @@ end;
Procedure THandleStream.SetSize(const NewSize: Int64);
begin
FileTruncate(FHandle,NewSize);
// We set the position afterwards, because the size can also be larger.
if not FileTruncate(FHandle,NewSize) then
Raise EInOutError.Create(SStreamSetSize);
Position:=NewSize;
end;