summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcmd.cpp
diff options
context:
space:
mode:
author quasiscroto <quasiscroto@users.noreply.github.com>2020-03-13 13:18:04 -0700
committer quasiscroto <quasiscroto@users.noreply.github.com>2020-03-13 13:18:04 -0700
commitea77f856a053665f3d8b77eb0fcfcba2d5fd1d86 (patch)
tree79ce24c9c8eb55082f089ee566310e0aa4710318 /src/emu/debug/debugcmd.cpp
parent98884c10d8fa856f7cf8a13d7a76825270435c9e (diff)
Fix two cases where debugger can crash mame ("cheatlist" command before "cheatinit", long strings after "help")
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r--src/emu/debug/debugcmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index 41ae0b698a1..c8559ee1fae 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -2535,6 +2535,12 @@ void debugger_commands::execute_cheatlist(int ref, const std::vector<std::string
u64 sizemask;
FILE *f = nullptr;
+ if (m_cheat.cpu[0] == 0)
+ {
+ m_console.printf("Use cheatinit before cheatlist\n");
+ return;
+ }
+
if (!validate_cpu_space_parameter(m_cheat.cpu, AS_PROGRAM, space))
return;