From 4652593a8c13f551efd3313da8616d7ca996d3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 18 Mar 2025 15:33:16 +0100 Subject: [PATCH] convert lfnstrs to array of ansichar --- compiler/owar.pas | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/owar.pas b/compiler/owar.pas index ed0408e1c3..70df020c3a 100644 --- a/compiler/owar.pas +++ b/compiler/owar.pas @@ -64,7 +64,7 @@ type tarobjectreader=class(tobjectreader) private ArSymbols : TFPHashObjectList; - LFNStrs : PChar; + LFNStrs : TAnsiCharDynArray; LFNSize : longint; CurrMemberPos, CurrMemberSize : longint; @@ -353,8 +353,7 @@ implementation begin inherited closefile; ArSymbols.Free; - if assigned(LFNStrs) then - FreeMem(LFNStrs); + LFNStrs:=nil; inherited Destroy; end; @@ -515,8 +514,8 @@ implementation if DecodeMemberName(currarhdr)='/' then begin lfnsize:=DecodeMemberSize(currarhdr); - getmem(lfnstrs,lfnsize); - Read(lfnstrs^,lfnsize); + setLength(lfnstrs,lfnsize); + Read(lfnstrs[0],lfnsize); end; end;