* check zero length instead of comparing to empty string

This commit is contained in:
Michael VAN CANNEYT 2023-01-06 11:54:32 +01:00 committed by Michaël Van Canneyt
parent 057cfc100c
commit 4d42d013b8

View File

@ -13,14 +13,14 @@
**********************************************************************}
{$ifndef FPC_UNIT_HAS_STRPCOPY}
function strpcopy(d : PAnsiChar;const s : string) : PAnsiChar;
function strpcopy(d : PAnsiChar;const s : shortstring) : PAnsiChar;
var
counter : byte;
Begin
counter := 0;
{ if empty pascal string }
{ then setup and exit now }
if s = '' then
if Length(s)=0 then
Begin
D[0] := #0;
StrPCopy := D;