printf: %#x or %#X conversions should not print the 0x/0X prefix if the value is 0.

This is the behavior specified in all versions of the C standards.
This commit is contained in:
Stephen Heumann 2021-01-30 16:04:18 -06:00
parent 37c38a7077
commit 71a25f0fef
1 changed files with 6 additions and 1 deletions

View File

@ -4052,7 +4052,12 @@ cn2 lda [argp]
beq cn2a
and #$00FF
cn2a sta ~num
stz ~hexPrefix assume we won't lead with 0x
ora ~num+2
ora ~num+4
ora ~num+6
bne cn2b
stz ~altForm if value is 0, do not print hex prefix
cn2b stz ~hexPrefix assume we won't lead with 0x
;
; Convert the number to an ASCII string
;