fixed fread
This commit is contained in:
parent
9f13a6a654
commit
16892e5e6c
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ size_t fread(void *p, size_t recl, size_t nrec, FILE *f){
|
|||
memcpy(s, f->rp, d);
|
||||
f->rp+=d;
|
||||
}else{
|
||||
if(n >= BIGN && f->state==RD && !(f->flags&STRING) && f->buf!=f->unbuf){
|
||||
if(n >= BIGN && f->state==RD && !(f->flags&STRING) && f->buf!=f->unbuf || f->buf == f->unbuf){
|
||||
d=read(f->fd, s, n);
|
||||
if(d<=0){
|
||||
f->state=(d==0)?END:ERR;
|
||||
|
|
Loading…
Reference in a new issue