mirror of https://github.com/mgba-emu/mgba.git
Core: Add sanity check for mDirectorySetOpenSuffix
This commit is contained in:
parent
541ed9606c
commit
5fb7c5e3ee
|
@ -110,6 +110,9 @@ struct VFile* mDirectorySetOpenPath(struct mDirectorySet* dirs, const char* path
|
||||||
}
|
}
|
||||||
|
|
||||||
struct VFile* mDirectorySetOpenSuffix(struct mDirectorySet* dirs, struct VDir* dir, const char* suffix, int mode) {
|
struct VFile* mDirectorySetOpenSuffix(struct mDirectorySet* dirs, struct VDir* dir, const char* suffix, int mode) {
|
||||||
|
if (!dir) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
char name[PATH_MAX + 1] = "";
|
char name[PATH_MAX + 1] = "";
|
||||||
snprintf(name, sizeof(name) - 1, "%s%s", dirs->baseName, suffix);
|
snprintf(name, sizeof(name) - 1, "%s%s", dirs->baseName, suffix);
|
||||||
return dir->openFile(dir, name, mode);
|
return dir->openFile(dir, name, mode);
|
||||||
|
|
Loading…
Reference in New Issue