Browse Source

fixed result of strlcopy

peter 21 years ago
parent
commit
e85d8c970c
1 changed files with 7 additions and 2 deletions
  1. 7 2
      rtl/i386/strings.inc

+ 7 - 2
rtl/i386/strings.inc

@@ -134,6 +134,7 @@ end;
 {$define FPC_UNIT_HAS_STRLCOPY}
 {$define FPC_UNIT_HAS_STRLCOPY}
 function strlcopy(dest,source : pchar;maxlen : sizeint) : pchar;assembler;
 function strlcopy(dest,source : pchar;maxlen : sizeint) : pchar;assembler;
 var
 var
+  savedest,
   saveesi,saveedi : longint;
   saveesi,saveedi : longint;
 asm
 asm
         movl    %edi,saveedi
         movl    %edi,saveedi
@@ -141,6 +142,7 @@ asm
         movl    source,%esi
         movl    source,%esi
         movl    maxlen,%ecx
         movl    maxlen,%ecx
         movl    dest,%edi
         movl    dest,%edi
+        movl    %edi,savedest
         orl     %ecx,%ecx
         orl     %ecx,%ecx
         jz      .LSTRLCOPY2
         jz      .LSTRLCOPY2
         cld
         cld
@@ -156,7 +158,7 @@ asm
         xorb    %al,%al         // If cutted
         xorb    %al,%al         // If cutted
         stosb                   // add a #0
         stosb                   // add a #0
 .LSTRLCOPY3:
 .LSTRLCOPY3:
-        movl    dest,%eax
+        movl    savedest,%eax
         movl    saveedi,%edi
         movl    saveedi,%edi
         movl    saveesi,%esi
         movl    saveesi,%esi
 end;
 end;
@@ -633,7 +635,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.15  2004-06-13 10:49:50  florian
+  Revision 1.16  2004-11-04 20:57:33  peter
+  fixed result of strlcopy
+
+  Revision 1.15  2004/06/13 10:49:50  florian
     * fixed some bootstrapping problems as well as some 64 bit stuff
     * fixed some bootstrapping problems as well as some 64 bit stuff
 
 
   Revision 1.14  2004/05/01 15:26:33  jonas
   Revision 1.14  2004/05/01 15:26:33  jonas