mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-11 02:03:25 +01:00
* check zero length instead of comparing to empty string
This commit is contained in:
parent
057cfc100c
commit
4d42d013b8
@ -13,14 +13,14 @@
|
|||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
{$ifndef FPC_UNIT_HAS_STRPCOPY}
|
{$ifndef FPC_UNIT_HAS_STRPCOPY}
|
||||||
function strpcopy(d : PAnsiChar;const s : string) : PAnsiChar;
|
function strpcopy(d : PAnsiChar;const s : shortstring) : PAnsiChar;
|
||||||
var
|
var
|
||||||
counter : byte;
|
counter : byte;
|
||||||
Begin
|
Begin
|
||||||
counter := 0;
|
counter := 0;
|
||||||
{ if empty pascal string }
|
{ if empty pascal string }
|
||||||
{ then setup and exit now }
|
{ then setup and exit now }
|
||||||
if s = '' then
|
if Length(s)=0 then
|
||||||
Begin
|
Begin
|
||||||
D[0] := #0;
|
D[0] := #0;
|
||||||
StrPCopy := D;
|
StrPCopy := D;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user