mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
[OSX] Fix "SIGILL: illegal instruction" on macOS Catalina
on OSX, strncpy may copy to overlapping (protected) memory. this sometimes happens when loading WAD files. This patch eliminates these problems for me
This commit is contained in:
parent
b426ed81dd
commit
4548662536
1 changed files with 4 additions and 1 deletions
|
|
@ -150,7 +150,10 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors)
|
|||
{
|
||||
FILE *handle;
|
||||
|
||||
strncpy(filenamebuf, *filename, MAX_WADPATH);
|
||||
if (filenamebuf != *filename) {
|
||||
// avoid overlap
|
||||
strncpy(filenamebuf, *filename, MAX_WADPATH);
|
||||
}
|
||||
filenamebuf[MAX_WADPATH - 1] = '\0';
|
||||
*filename = filenamebuf;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue