From 6bc1c3741c4a38ef8de523c003353c5e1fe5a60c Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 11 Jun 2023 16:05:12 -0500 Subject: [PATCH] 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. --- stdio.asm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/stdio.asm b/stdio.asm index 6c2b7bb..1f4bdd0 100644 --- a/stdio.asm +++ b/stdio.asm @@ -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