From: cuz Date: Sat, 27 Jul 2002 07:31:13 +0000 (+0000) Subject: Reintroduce a patch for a bug that has been lost between version 1.2 and 1.3 X-Git-Tag: V2.12.0~2254 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=58ef7c8df5df78e0fff188f1cdc339761d1de561;p=cc65 Reintroduce a patch for a bug that has been lost between version 1.2 and 1.3 of the vsprintf module. git-svn-id: svn://svn.cc65.org/cc65/trunk@1372 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/common/vsprintf.s b/libsrc/common/vsprintf.s index 317987807..2313900ae 100644 --- a/libsrc/common/vsprintf.s +++ b/libsrc/common/vsprintf.s @@ -152,10 +152,13 @@ _vsprintf: tya sta (ptr1),y -; Return the number of bytes written. - - lda outdesc ; ccount - ldx outdesc+1 - rts - +; Return the number of bytes written. The carry is clear here because of the +; last addition which will never overflow for sane code. + + lda outdesc ; ccount + ldx outdesc+1 + adc #1 ; Account for terminator + bcc @L9 + inx +@L9: rts