sprintf/vsprintf should write a terminating null character even if the string produced is empty.

They were just not writing anything in this case.
This commit is contained in:
Stephen Heumann 2018-03-05 18:02:36 -06:00
parent 6006cefc70
commit 8562842f66
1 changed files with 16 additions and 0 deletions

View File

@ -2662,6 +2662,14 @@ sprintf start
plb
plx remove the return address
ply
phd initialize output to empty string
tsc
tcd
short M
lda #0
sta [3]
long M
pld
pla save the stream
sta string
pla
@ -3143,6 +3151,14 @@ vsprintf start
plb
plx remove the return address
ply
phd initialize output to empty string
tsc
tcd
short M
lda #0
sta [3]
long M
pld
pla save the stream
sta string
pla