fread: do not try to read if EOF flag is set.

This behavior is implied by the specification of fread in terms of fgetc.
This commit is contained in:
Stephen Heumann 2022-07-03 20:04:12 -05:00
parent ef63f26c4f
commit 89b501f259
1 changed files with 4 additions and 0 deletions

View File

@ -1613,6 +1613,10 @@ p equ 5
ph4 <stream verify that stream exists
jsl ~VerifyStream
jcs lb6
ldy #FILE_flag quit if end of file has been reached
lda [stream],Y
bit #_IOEOF
jne lb6
mul4 element_size,count,rdRequestCount set the # of bytes
move4 rdRequestCount,temp save full request count
pb1 lda rdRequestCount quit if the request count is 0