From: cuz Date: Sun, 17 Aug 2003 20:15:01 +0000 (+0000) Subject: Fixed a bug X-Git-Tag: V2.12.0~1384 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3a78b76b95336b6ac0fb29d4d54d6bbf91615939;p=cc65 Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@2355 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- 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