Fix crash when PSVariantToString was called on a btPChar type.

git-svn-id: http://code.remobjects.com/svn/pascalscript@31 5c9d2617-0215-0410-a2ee-e80e04d1c6d8
This commit is contained in:
jr 2007-03-12 00:32:41 +00:00
parent 0483833f75
commit 8691cd91cc

View File

@ -1527,7 +1527,14 @@ begin
btSingle: str(tbtsingle(p.dta^), Result); btSingle: str(tbtsingle(p.dta^), Result);
btDouble: str(tbtdouble(p.dta^), Result); btDouble: str(tbtdouble(p.dta^), Result);
btExtended: str(tbtextended(p.dta^), Result); btExtended: str(tbtextended(p.dta^), Result);
btString, btPChar: Result := makestring(string(p.dta^)); btString: Result := makestring(string(p.dta^));
btPChar:
begin
if PChar(p.dta^) = nil then
Result := 'nil'
else
Result := MakeString(PChar(p.dta^));
end;
btchar: Result := MakeString(tbtchar(p.dta^)); btchar: Result := MakeString(tbtchar(p.dta^));
{$IFNDEF PS_NOWIDESTRING} {$IFNDEF PS_NOWIDESTRING}
btwidechar: Result := MakeWString(tbtwidechar(p.dta^)); btwidechar: Result := MakeWString(tbtwidechar(p.dta^));