Fix bug introduced with astring changes that caused malformed tokens

when writing out cfg files.
This commit is contained in:
Aaron Giles 2010-01-18 17:01:31 +00:00
parent c080374784
commit bfc69c877f

View File

@ -1353,7 +1353,7 @@ astring &input_code_to_token(running_machine *machine, astring &string, input_co
devindex[0] = 0; devindex[0] = 0;
/* determine the itemid part; look up in the table if we don't have a token */ /* determine the itemid part; look up in the table if we don't have a token */
if (item != NULL && item->token != NULL) if (item != NULL && item->token.len() != 0)
devcode = item->token; devcode = item->token;
else else
{ {
@ -1450,7 +1450,7 @@ input_code input_code_from_token(running_machine *machine, const char *_token)
for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++) for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
{ {
input_device_item *item = device->item[itemid]; input_device_item *item = device->item[itemid];
if (item != NULL && item->token != NULL && token[curtok].cmp(item->token) == 0) if (item != NULL && token[curtok].cmp(item->token) == 0)
{ {
/* take the itemclass from the item */ /* take the itemclass from the item */
itemclass = item->itemclass; itemclass = item->itemclass;