convert lfnstrs to array of ansichar

This commit is contained in:
Michaël Van Canneyt 2025-03-18 15:33:16 +01:00
parent 859b100da6
commit 4652593a8c

View File

@ -64,7 +64,7 @@ type
tarobjectreader=class(tobjectreader) tarobjectreader=class(tobjectreader)
private private
ArSymbols : TFPHashObjectList; ArSymbols : TFPHashObjectList;
LFNStrs : PChar; LFNStrs : TAnsiCharDynArray;
LFNSize : longint; LFNSize : longint;
CurrMemberPos, CurrMemberPos,
CurrMemberSize : longint; CurrMemberSize : longint;
@ -353,8 +353,7 @@ implementation
begin begin
inherited closefile; inherited closefile;
ArSymbols.Free; ArSymbols.Free;
if assigned(LFNStrs) then LFNStrs:=nil;
FreeMem(LFNStrs);
inherited Destroy; inherited Destroy;
end; end;
@ -515,8 +514,8 @@ implementation
if DecodeMemberName(currarhdr)='/' then if DecodeMemberName(currarhdr)='/' then
begin begin
lfnsize:=DecodeMemberSize(currarhdr); lfnsize:=DecodeMemberSize(currarhdr);
getmem(lfnstrs,lfnsize); setLength(lfnstrs,lfnsize);
Read(lfnstrs^,lfnsize); Read(lfnstrs[0],lfnsize);
end; end;
end; end;