Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2002-09

Bugfix fo writer.inc

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

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
  ;
  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

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 25 lines
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 ; 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;

Applied, thanks !

Michael

Reply by email

Pavel V. Ozerski
to Michael Van Canneyt

At begin of this autumn I had some problem with off-line E-mail access. Although now all is relatively OK, I cannot get something from this mailing list. When I tried to subscribe again using this my address, I got message that I'm already subscribed, but no mails were recieved. May be, I should try to unsubscribe and then to subscribe again? But how to unsubscribe?

Sincerely, Pavel

Reply by email

Florian Klaempfl
to Pavel V. Ozerski
you wrote 6 lines
At begin of this autumn I had some problem with off-line E-mail access. Although now all is relatively OK, I cannot get something from this mailing list. When I tried to subscribe again using this my address, I got message that I'm already subscribed, but no mails were recieved. May be, I should try to unsubscribe and then to subscribe again? But how to unsubscribe?

Usually via the web interface, the link is at the bottom of each mail from the list.

Reply by email