* make sure that when making an ansistring shorter using setlength(),

it remains null-terminated

git-svn-id: branches/jvmbackend@18883 -
This commit is contained in:
Jonas Maebe 2011-08-28 19:22:29 +00:00
parent 3a423b331c
commit 7c56dbee12

View File

@ -417,6 +417,8 @@ begin
result:=s;
{ +1 for terminating #0 }
setlength(AnsistringClass(result).fdata,l+1);
{ null-terminate in case the string became shorter }
AnsistringClass(result).fdata[l]:=#0;
end;
{*****************************************************************************