summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-10-01 16:56:42 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-10-01 16:56:42 +0000
commiteb943f05d74038605e3f0a702a2f0db85419929b (patch)
tree98db50b6916743a8e3b30935bbc8bd6140ecd22a /src/emu
parent8d68eede3842e2d840e7ef6f6f4adec84c742d98 (diff)
From: David Haywood [neohaze@nildram.co.uk]
Sent: Friday, September 25, 2009 12:15 PM To: Aaron Giles Subject: 360 pad crash This 'fixes' the bug where MAME crashes and corrupts your config files if you connect a pad at runtime. Previously there was an assert, now it simply doesn't execute that block of code if devcode is null. I don't know if this is the best fix (it would probably be quite nice if it could detect pads being added removed at runtime and adapt to that) but at least it stops it crashing and corrupting files.
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/input.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/emu/input.c b/src/emu/input.c
index 2e413bdf9fc..d65362d153d 100644
--- a/src/emu/input.c
+++ b/src/emu/input.c
@@ -1357,8 +1357,11 @@ astring *input_code_to_token(running_machine *machine, astring *string, input_co
if (item != NULL && item->token != NULL)
devcode = astring_c(item->token);
else
+ {
devcode = code_to_string(itemid_token_table, INPUT_CODE_ITEMID(code));
- assert(devcode != NULL);
+ if (devcode == NULL)
+ devcode = "UNKNOWN";
+ }
/* determine the modifier part */
modifier = code_to_string(modifier_token_table, INPUT_CODE_MODIFIER(code));