fixed wip mods crashing joiners

This is a temporary fix for a much larger issue in commit 3dd9226bc9
The problem is data sizes. The min function was being treated as a different data size since its no longer using the type agnostic macros.
This commit is contained in:
Isaac0-dev 2024-11-27 00:38:04 +10:00
parent e4fd83bec7
commit e5a51a6687

View file

@ -93,7 +93,7 @@ size_t f_read(void *dst, size_t size, size_t count, FILE *f) {
file_t *file = f_get_file_from_handle(f);
if (!file) return fread(dst, size, count, f);
if (file->pos >= file->size) return 0;
count = min(count, ((file->size - file->pos) / size));
count = MIN(count, ((file->size - file->pos) / size));
memcpy(dst, file->data + file->pos, count * size);
file->pos += count * size;
return count;