Hi,

TFile.ReadAllBytes (in System.IOUtils) seems to alwasy return TBytes
filled with zero's.

It's implemented as
(See: 
https://gitlab.com/freepascal.org/fpc/source/-/blob/fixes_3_2/packages/vcl-compat/src/system.ioutils.pp?ref_type=heads)

class function TFile.ReadAllBytes(const aPath: string): TBytes;

begin
  Result:=[];
  With OpenRead(aPath) do
    try
       SetLength(Result,Size);
       ReadBuffer(Result,0);  << second param should be "Size"
    finally
      Free;
    end;
end;


This is fixed in main.
https://gitlab.com/freepascal.org/fpc/source/-/commit/9eb77599e18c89bbe426bf272233540206893271

I think it's not been merged to fixes branch,

Shoud I file a bugreport about it?
-- 
Bart
_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to