mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
Fixed a crash in KQ1SCI, when the user types something wrong - the game tries to open a file with an empty file name, and an odd file mode
svn-id: r44491
This commit is contained in:
parent
1497f9845a
commit
c76041d46d
@ -753,6 +753,10 @@ reg_t kFileIO(EngineState *s, int argc, reg_t *argv) {
|
||||
Common::String name = s->segMan->getString(argv[1]);
|
||||
int mode = argv[2].toUint16();
|
||||
|
||||
if (name.empty()) {
|
||||
warning("Attempted to open a file with an empty filename");
|
||||
return make_reg(0, SIGNAL_OFFSET);
|
||||
}
|
||||
file_open(s, name.c_str(), mode);
|
||||
debug(3, "K_FILEIO_OPEN(%s,0x%x)", name.c_str(), mode);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user