瀏覽代碼

* fixed return of strcat,strlcat

peter 26 年之前
父節點
當前提交
eea78419c8
共有 1 個文件被更改,包括 11 次插入6 次删除
  1. 11 6
      rtl/inc/stringsi.inc

+ 11 - 6
rtl/inc/stringsi.inc

@@ -4,7 +4,7 @@
     Copyright (c) 1999 by the Free Pascal development team
     Copyright (c) 1999 by the Free Pascal development team
 
 
     Processor independent part for strings and sysutils units
     Processor independent part for strings and sysutils units
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -17,7 +17,8 @@
     function strcat(dest,source : pchar) : pchar;
     function strcat(dest,source : pchar) : pchar;
 
 
       begin
       begin
-         strcat:=strcopy(strend(dest),source);
+        strcopy(strend(dest),source);
+        strcat:=dest;
       end;
       end;
 
 
     function strlcat(dest,source : pchar;l : longint) : pchar;
     function strlcat(dest,source : pchar;l : longint) : pchar;
@@ -27,8 +28,9 @@
 
 
       begin
       begin
          destend:=strend(dest);
          destend:=strend(dest);
-         l:=l-(destend-dest);
-         strlcat:=strlcopy(destend,source,l);
+         dec(l,destend-dest);
+         strlcopy(destend,source,l);
+         strlcat:=dest;
       end;
       end;
 
 
     function strmove(dest,source : pchar;l : longint) : pchar;
     function strmove(dest,source : pchar;l : longint) : pchar;
@@ -79,7 +81,10 @@
       end;
       end;
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1999-02-25 10:05:07  michael
+  Revision 1.3  1999-09-01 09:25:10  peter
+    * fixed return of strcat,strlcat
+
+  Revision 1.2  1999/02/25 10:05:07  michael
   + Added header and log
   + Added header and log
 
 
-}
+}