[fpc-devel]Bugfix fo writer.inc
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Sep 20 12:33:56 CEST 2002
Hi,
I found a bug in TBinaryObjectWriter.Write (fcl/inc/writer.inc).
'Buffer' is not adjusted if FBuffer is full. Diff is attached and here is the proc:
procedure TBinaryObjectWriter.Write(const Buffer; Count: LongInt);
var
CopyNow: LongInt;
SourceBuf: PChar;
begin
SourceBuf:=@Buffer;
while Count > 0 do
begin
CopyNow := Count;
if CopyNow > FBufSize - FBufPos then
CopyNow := FBufSize - FBufPos;
Move(SourceBuf^, PChar(FBuffer)[FBufPos], CopyNow);
Dec(Count, CopyNow);
Inc(FBufPos, CopyNow);
inc(SourceBuf, CopyNow);
if FBufPos = FBufSize then
FlushBuffer;
end;
end;
Mattias Gaertner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.tgz
Type: application/x-gzip
Size: 634 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20020920/ada55a51/attachment.bin>
More information about the fpc-devel
mailing list