summaryrefslogtreecommitdiff
path: root/src/cache
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-01-29 16:45:30 -0500
committerAndrew Opalach <andrew@akon.city> 2025-01-29 16:45:30 -0500
commit6134465ddc10f8b43bddf74209f0ec8654595041 (patch)
tree49eb55da3d08abdc7dea9628c3ae9674dfe7afde /src/cache
parent457a3cc1a04e45e31370d9083186436b0d12ab1d (diff)
downloadcamu-6134465ddc10f8b43bddf74209f0ec8654595041.tar.gz
camu-6134465ddc10f8b43bddf74209f0ec8654595041.tar.bz2
camu-6134465ddc10f8b43bddf74209f0ec8654595041.zip
Fixes and optimizations around seek and loop
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/cache')
-rw-r--r--src/cache/handle.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cache/handle.c b/src/cache/handle.c
index 10d1992..9f39f8e 100644
--- a/src/cache/handle.c
+++ b/src/cache/handle.c
@@ -24,7 +24,9 @@ s32 cch_handle_read(struct cch_handle *handle, u8 *buf, s32 size)
off_t filesize = cch_entry_get_size(handle->entry);
if (size < 0) filesize = wait_for_size(handle, handler);
if (filesize > 0) {
- if (handle->pointer >= filesize) return CAMU_ERR_EOF;
+ if (handle->pointer >= filesize) {
+ return CAMU_ERR_EOF;
+ }
if (handle->pointer + size >= filesize) {
size = filesize - handle->pointer;
}