* Set FBufferCount to -1 instead of 0 when there are no buffers initialized. Bug #13539

git-svn-id: trunk@13044 -
This commit is contained in:
joost 2009-04-25 20:33:18 +00:00
parent 80c0f33c0e
commit 17e322cf57

View File

@ -34,7 +34,7 @@ begin
// pointer(FBuffers^) := nil;
FBuffers[0] := nil;
FActiveRecord := 0;
FBufferCount := 0;
FBufferCount := -1;
FEOF := True;
FBOF := True;
FIsUniDirectional := False;
@ -1172,7 +1172,7 @@ begin
{$ifdef dsdebug}
Writeln (' Filling memory :',(Value+1-FBufferCount)*SizeOf(PChar));
{$endif}
if FBufferCount > 0 then inc(FBufferCount); // Cause FBuffers[FBufferCount] is already allocated
inc(FBufferCount); // Cause FBuffers[FBufferCount] is already allocated
FillChar(FBuffers[FBufferCount],(Value+1-FBufferCount)*SizeOF(Pchar),#0);
{$ifdef dsdebug}
Writeln (' Filled memory :');
@ -1222,10 +1222,10 @@ begin
ReAllocMem(FBuffers,(Value+1)*SizeOf(Pchar));
end;
end;
FBufferCount:=Value;
If Value=-1 then
Value:=0;
if FRecordcount > Value then FRecordcount := Value;
FBufferCount:=Value;
{$ifdef dsdebug}
Writeln (' SetBufListSize: Final FBufferCount=',FBufferCount);
{$endif}