소스 검색

* check zero length instead of comparing to empty string

Michael VAN CANNEYT 2 년 전
부모
커밋
ab3a7d540c
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      rtl/inc/genstrs.inc

+ 2 - 2
rtl/inc/genstrs.inc

@@ -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;