summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author Wilbert Pol <wilbert@jdg.info>2014-06-23 20:02:16 +0000
committer Wilbert Pol <wilbert@jdg.info>2014-06-23 20:02:16 +0000
commit0a6b226debe21836535a916905d3e010d5ec0413 (patch)
tree080a85b98d6e731fe7f0bec20fc717a9656c9e72 /src/emu
parent65cd55ff6b3284b1d1dd6234625e1e26d7f636f6 (diff)
Different version of OSX segfault fix (nw)
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/clifront.c2
-rw-r--r--src/emu/emucore.h32
2 files changed, 23 insertions, 11 deletions
diff --git a/src/emu/clifront.c b/src/emu/clifront.c
index 2fd6f851d6e..55250b30fa5 100644
--- a/src/emu/clifront.c
+++ b/src/emu/clifront.c
@@ -194,7 +194,7 @@ int cli_frontend::execute(int argc, char **argv)
if (!found)
{
software_list_device::display_matches(config, NULL, m_options.software_name());
- throw emu_fatalerror(MAMERR_FATALERROR, "");
+ throw emu_fatalerror(MAMERR_FATALERROR, NULL);
}
}
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index 450c23b7584..695eb2eeb5a 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -290,33 +290,45 @@ public:
emu_fatalerror(const char *format, ...) ATTR_PRINTF(2,3)
: code(0)
{
- va_list ap;
- va_start(ap, format);
- vsprintf(text, format, ap);
- va_end(ap);
+ if (format != NULL)
+ {
+ va_list ap;
+ va_start(ap, format);
+ vsprintf(text, format, ap);
+ va_end(ap);
+ }
osd_break_into_debugger(text);
}
emu_fatalerror(const char *format, va_list ap)
: code(0)
{
- vsprintf(text, format, ap);
+ if (format != NULL)
+ {
+ vsprintf(text, format, ap);
+ }
osd_break_into_debugger(text);
}
emu_fatalerror(int _exitcode, const char *format, ...) ATTR_PRINTF(3,4)
: code(_exitcode)
{
- va_list ap;
- va_start(ap, format);
- vsprintf(text, format, ap);
- va_end(ap);
+ if (format != NULL)
+ {
+ va_list ap;
+ va_start(ap, format);
+ vsprintf(text, format, ap);
+ va_end(ap);
+ }
}
emu_fatalerror(int _exitcode, const char *format, va_list ap)
: code(_exitcode)
{
- vsprintf(text, format, ap);
+ if (format != NULL)
+ {
+ vsprintf(text, format, ap);
+ }
}
const char *string() const { return text; }