From: Greg King Date: Sat, 18 Jul 2015 00:36:56 +0000 (-0400) Subject: Fixed a hardware-stack leak. X-Git-Tag: V2.16~247^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0b6bcb565e7f514c09bcd1c7b44d3e1bc8791e32;p=cc65 Fixed a hardware-stack leak. --- diff --git a/libsrc/common/vsnprintf.s b/libsrc/common/vsnprintf.s index 01bcd6406..228e531d0 100644 --- a/libsrc/common/vsnprintf.s +++ b/libsrc/common/vsnprintf.s @@ -2,7 +2,7 @@ ; int __fastcall__ vsnprintf (char* Buf, size_t size, const char* Format, va_list ap); ; ; 2009-09-26, Ullrich von Bassewitz -; 2015-07-09, Greg King +; 2015-07-17, Greg King ; .export _vsnprintf, vsnprintf @@ -131,12 +131,15 @@ L4: lda ccount+0 ; Bail out if size is too high. -L9: lda #ERANGE +L9: ldy #ERANGE .byte $2C ;(bit $xxxx) ; NULL buffer pointers usually are invalid. -L0: lda #EINVAL +L0: ldy #EINVAL + pla ; Drop ap + pla + tya jsr __directerrno ; Return -1 jmp incsp6 ; Drop parameters