scanf: Do not test for EOF at the beginning of scanf processing.

If the format string is empty or contains only %n conversions, then nothing should be read from the stream, so no error should be indicated even if it is at EOF. If a directive does read from the stream and encounter EOF, that will be handled when the directive is processed.

This could cause scanf to pause waiting for input from the console in cases where it should not.
This commit is contained in:
Stephen Heumann 2023-06-11 16:05:12 -05:00
parent 614af65c68
commit 6bc1c3741c
1 changed files with 0 additions and 5 deletions

View File

@ -6151,11 +6151,6 @@ ps stz ~assignments no assignments yet
stz ~scanCount no characters scanned
stz ~scanError no scan error so far
stz ~eofFound eof was not the first char
jsl ~getchar test for eof
cmp #EOF
bne ps0
sta ~eofFound
ps0 jsl ~putback
ps1 lda ~scanError quit if a scan error has occurred
bne rm1