From 3a78b76b95336b6ac0fb29d4d54d6bbf91615939 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 17 Aug 2003 20:15:01 +0000 Subject: [PATCH] Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@2355 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/strncpy.s | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/common/strncpy.s b/libsrc/common/strncpy.s index 3ba03301b..564814599 100644 --- a/libsrc/common/strncpy.s +++ b/libsrc/common/strncpy.s @@ -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 -- 2.39.5