fcl-res: #0 as terminator is still needed (anyway toread is still needed - for some resource generator this value can be 0 and #0 terminator doesn't exist).

git-svn-id: trunk@37687 -
This commit is contained in:
maciej-izak 2017-12-06 10:19:52 +00:00
parent d4acc80ba6
commit 919cc7f307

View File

@ -311,7 +311,6 @@ end;
function TVersionResource.ReadWideString(toread: integer): string;
var w : word;
ws : widestring;
i: integer = 0;
begin
ws:='';
if toread=0 then
@ -319,17 +318,13 @@ begin
w:=0;
repeat
RawData.ReadBuffer(w,2);
if (toread=-1) and (w = 0) then break;
if (w = 0) then break;
{$IFDEF ENDIAN_BIG}
w:=SwapEndian(w);
{$ENDIF}
ws:=ws+widechar(w);
inc(i);
until i = toread;
until false;
Result:=ws;
// last #0 should be excluded (#0 is implicitly added for string)
if (toread<>-1) and (Result[i] = #0) then
SetLength(Result, i-1);
end;
procedure TVersionResource.WriteFixedBlockLength(const position: int64);