mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-05-01 06:08:00 +03:00
file: fix ub for unknown opening modes
This commit is contained in:
parent
df74117175
commit
10066506aa
1 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,9 @@ MYFILE *FileOpen(const char *path, FILE_OPEN_MODE mode)
|
|||
case FILE_OPEN_READ:
|
||||
file->fp = fopen(path, "rb");
|
||||
break;
|
||||
default:
|
||||
file->fp = NULL;
|
||||
break;
|
||||
}
|
||||
if (!file->fp) {
|
||||
free(file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue