mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 08:47:28 +01:00
Add wuffs_base__io_reader__is_eof
This commit is contained in:
1 parent
128e6c06bb
commit
abe08bc6f6
9 files changed
+59
-42
No files matched your search
+6
-2
@@ -1657,6 +1657,11 @@ static inline bool wuffs_base__io_buffer__is_valid(wuffs_base__io_buffer buf) {
|
||||
(buf.wi >= buf.ri);
|
||||
}
|
||||
|
||||
static inline bool wuffs_base__io_reader__is_eof(wuffs_base__io_reader o) {
|
||||
wuffs_base__io_buffer* buf = o.private_impl.buf;
|
||||
return buf && buf->closed && (buf->ptr + buf->wi == o.private_impl.bounds[1]);
|
||||
}
|
||||
|
||||
static inline bool wuffs_base__io_reader__is_valid(wuffs_base__io_reader o) {
|
||||
wuffs_base__io_buffer* buf = o.private_impl.buf;
|
||||
// Note: if making this function public (i.e. moving it to base-header.h), it
|
||||
@@ -2192,8 +2197,7 @@ exit:
|
||||
return status;
|
||||
|
||||
short_read_src:
|
||||
if (a_src.private_impl.buf && a_src.private_impl.buf->closed &&
|
||||
!a_src.private_impl.limit.ptr_to_len) {
|
||||
if (wuffs_base__io_reader__is_eof(a_src)) {
|
||||
status = WUFFS_ZLIB__ERROR_UNEXPECTED_EOF;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user