From e5a51a66870c89463c04040aedb1eed686144455 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Wed, 27 Nov 2024 00:38:04 +1000 Subject: [PATCH] fixed wip mods crashing joiners This is a temporary fix for a much larger issue in commit https://github.com/coop-deluxe/sm64coopdx/commit/3dd9226bc9b6c301119c15eb975e0ee1fce7f196 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. --- src/pc/fs/fmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pc/fs/fmem.c b/src/pc/fs/fmem.c index f8650587b..69548aeb4 100644 --- a/src/pc/fs/fmem.c +++ b/src/pc/fs/fmem.c @@ -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;