This commit is contained in:
Julian Barathieu 2019-05-07 23:21:02 +02:00
parent 39e46a072f
commit 821b3b26c6
1 changed files with 8 additions and 2 deletions

View File

@ -31,7 +31,7 @@ error_t BGetFromBuf(Buffer_t *buf, uchar *ch)
assert(buf && buf->initDone == INITOK);
if (!buf) return EINVAL;
if (buf->state != BS_RDWR && buf->state != BS_RDONLY) {
if (buf->flags & BUF_TERM || buf->state != BS_RDWR && buf->state != BS_RDONLY) {
return EBADF;
}
@ -47,6 +47,12 @@ error_t bgetc(Buffer_t *buf, uchar *ch)
if (buf->flags & (BF_EOF|BF_ERR)) return EENDF;
return EOK;
if (
if (rc != EOK) {
// buf->flags |= BF_ERR;
}
return rc;
}