mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 06:49:16 +02:00
* Fixed chararray to ansistring conversion
This commit is contained in:
parent
d864c6d8c3
commit
b149cc5681
@ -266,14 +266,20 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
Procedure CharArray_To_AnsiStr(var a : ansistring;p : pchar;l:longint);[Public,Alias : 'FPC_CHARARRAY_TO_ANSISTR'];
|
Procedure CharArray_To_AnsiStr(var a : ansistring;p : pchar;l:longint);[Public,Alias : 'FPC_CHARARRAY_TO_ANSISTR'];
|
||||||
|
|
||||||
|
Var NewLen : Longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if p[0]=#0 Then
|
if p[0]=#0 Then
|
||||||
Pointer(a):=nil
|
Pointer(a):=nil
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Pointer(a):=NewAnsistring(L);
|
NewLen:=strlen(p);
|
||||||
SetLength(A,L);
|
If NewLen>L then
|
||||||
Move (P[0],Pointer(A)^,L)
|
newlen:=L;
|
||||||
|
Pointer(a):=NewAnsistring(NewLen);
|
||||||
|
SetLength(A,NewLen);
|
||||||
|
Move (P[0],Pointer(A)^,NewLen)
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -750,7 +756,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.15 1999-04-01 22:00:48 peter
|
Revision 1.16 1999-04-06 10:06:51 michael
|
||||||
|
* Fixed chararray to ansistring conversion
|
||||||
|
|
||||||
|
Revision 1.15 1999/04/01 22:00:48 peter
|
||||||
* universal names for str/val (ansistr instead of stransi)
|
* universal names for str/val (ansistr instead of stransi)
|
||||||
* '1.' support for val() this is compatible with tp7
|
* '1.' support for val() this is compatible with tp7
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user