scanf: when an ordinary character cannot match due to EOF, flag an input failure.
This may cause scanf to return EOF, if no conversions have been done. This seems to be the intent of the C standards, although the wording could be clearer. It is also consistent with all the other implementations I tested.
This commit is contained in:
parent
23a27bd434
commit
de9f830c0c
|
@ -5500,7 +5500,10 @@ ps5 stx ch make sure the char matches the format
|
|||
jsl ~getchar
|
||||
cmp ch
|
||||
beq ps1
|
||||
jsl ~putback put the character back
|
||||
cmp #EOF check for EOF
|
||||
bne ps6
|
||||
sta ~eofFound
|
||||
ps6 jsl ~putback put the character back
|
||||
;
|
||||
; Remove the parameters for remaining conversion specifications
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue