]> git.sur5r.net Git - cc65/commitdiff
Fixed a bug
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 17 Aug 2003 20:15:01 +0000 (20:15 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 17 Aug 2003 20:15:01 +0000 (20:15 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2355 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/common/strncpy.s

index 3ba03301b1f792d59df5301dcbe9a1ef4d97bbab..564814599f66c81ceabaf00d2e4e529cb8b46a17 100644 (file)
@@ -35,14 +35,14 @@ L1:     inx
 
 L2:     lda     (ptr1),y        ; Copy one character
         sta     (ptr2),y
-        beq     L3              ; Bail out if terminator reached
+        beq     L5              ; Bail out if terminator reached (A = 0)
         iny
         bne     L1
         inc     ptr1+1
         inc     ptr2+1          ; Bump high bytes
         bne     L1              ; Branch always
 
-; Fill the remaining bytes. A is zero if we come here
+; Fill the remaining bytes. 
 
 L3:     inx
         bne     L4
@@ -50,7 +50,7 @@ L3:     inx
         beq     L9
 
 L4:     sta     (ptr2),y
-        iny
+L5:     iny
         bne     L3
         inc     ptr2+1          ; Bump high byte
         bne     L3              ; Branch always