mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 06:31:36 +02:00
* Use dyn array of byte for CRC buffer
This commit is contained in:
parent
1068015c4d
commit
480200a708
@ -191,7 +191,7 @@ Implementation
|
|||||||
fs : TCStream;
|
fs : TCStream;
|
||||||
bufcount,
|
bufcount,
|
||||||
bufsize : Integer;
|
bufsize : Integer;
|
||||||
buf : pbyte;
|
buf : TByteDynArray;
|
||||||
begin
|
begin
|
||||||
result:=0;
|
result:=0;
|
||||||
bufsize:=64*1024;
|
bufsize:=64*1024;
|
||||||
@ -202,12 +202,12 @@ Implementation
|
|||||||
Comment(V_Error,'Can''t open file: '+fn);
|
Comment(V_Error,'Can''t open file: '+fn);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
getmem(buf,bufsize);
|
setlength(buf,bufsize);
|
||||||
repeat
|
repeat
|
||||||
bufcount:=fs.Read(buf^,bufsize);
|
bufcount:=fs.Read(buf[0],bufsize);
|
||||||
result:=UpdateCrc32(result,buf^,bufcount);
|
result:=UpdateCrc32(result,buf[0],bufcount);
|
||||||
until bufcount<bufsize;
|
until bufcount<bufsize;
|
||||||
freemem(buf);
|
buf:=nil;
|
||||||
fs.Free;
|
fs.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user