mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-05-01 14:17:58 +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:
|
case FILE_OPEN_READ:
|
||||||
file->fp = fopen(path, "rb");
|
file->fp = fopen(path, "rb");
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
file->fp = NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!file->fp) {
|
if (!file->fp) {
|
||||||
free(file);
|
free(file);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue