scanf: Report EOF for o/u/x conversions, if appropriate.

This was not being reported unless assignment was suppressed, because the "sta ~eofFound" instruction was too late.

(Found based on test cases by Rich Felker.)
This commit is contained in:
Stephen Heumann 2021-02-09 13:14:24 -06:00
parent 66e1835175
commit 2f68708b47
1 changed files with 2 additions and 2 deletions

View File

@ -5352,11 +5352,11 @@ Init stz read no chars read
in1 jsl ~getchar skip leading whitespace...
cmp #EOF if at EOF then
bne in2
sta ~eofFound eofFound = EOF
lda ~suppress if input is not suppressed then
bne in1a
dec ~assignments no assignment made
in1a sta ~eofFound eofFound = EOF
pla pop stack
in1a pla pop stack
bra lb6 bail out
in2 tax ...back to skipping whitespace
lda __ctype+1,X