mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 05:59:08 +02:00
* avoid range check errors for empty ansistrings written/read from ppus
git-svn-id: trunk@18253 -
This commit is contained in:
parent
e796a878ca
commit
275c6092e5
@ -947,8 +947,13 @@ begin
|
|||||||
error:=true;
|
error:=true;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
SetLength(Result,l);
|
if l>0 then
|
||||||
ReadData(result[1],l);
|
begin
|
||||||
|
SetLength(Result,l);
|
||||||
|
ReadData(result[1],l);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result:='';
|
||||||
inc(entryidx,l);
|
inc(entryidx,l);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1311,7 +1316,8 @@ procedure tppufile.putansistring(const s: ansistring);
|
|||||||
begin
|
begin
|
||||||
l:=length(s);
|
l:=length(s);
|
||||||
putdata(l,4);
|
putdata(l,4);
|
||||||
putdata(s[1],l);
|
if l>0 then
|
||||||
|
putdata(s[1],l);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user