From 9761ab52d9d4193aa9fde4c072aa86572d79bccb Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 14 Oct 2022 21:57:14 -0700 Subject: [PATCH] FIL_ReadFileTag: use fopenfile Fixes exec, for example, crashing the game if given a directory. Test: `exec .` --- src/m_misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index 6c346e5a1..495c40e8b 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -273,8 +273,8 @@ size_t FIL_ReadFileTag(char const *name, UINT8 **buffer, INT32 tag) size_t count, length; UINT8 *buf; - if (FIL_ReadFileOK(name)) - handle = fopen(name, "rb"); + //if (FIL_ReadFileOK(name)) + handle = fopenfile(name, "rb"); if (!handle) return 0;