-;
+;
; int vsprintf (char* Buf, const char* Format, va_list ap);
;
; Ullrich von Bassewitz, 1.12.2000
;
.export _vsprintf
- .import pushax, popax, push1
+ .import pushax, popax
.import _memcpy, __printf
.importzp sp, ptr1
; static void out (struct outdesc* d, const char* buf, unsigned count)
; /* Routine used for writing */
; {
-; /* String - be shure to check the size */
+; /* String - be sure to check the size */
; while (count-- && d->ccount < d->uns) {
; ((char*) d->ptr) [d->ccount] = *buf;
; ++buf;
tya
sta (ptr1),y
-; Return the number of bytes written. The carry is clear here because of the
-; last addition which will never overflow for sane code.
+; Return the number of bytes written.
- lda outdesc ; ccount
- ldx outdesc+1
- adc #1 ; Account for terminator
- bcc @L9
- inx
-@L9: rts
+ lda outdesc ; ccount
+ ldx outdesc+1
+ rts