summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/emu/machine/idectrl.c2
-rw-r--r--src/emu/uimenu.c10
-rw-r--r--src/mame/machine/seicop.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index a927a510c36..3e2e71c43fa 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -418,7 +418,7 @@ static void swap_strncpy(UINT8 *dst, const char *src, int field_size_in_words)
{
int i;
- for (i = 0; i < field_size_in_words * 2 && src[i]; i++)
+ for (i = 0; i < field_size_in_words * 2 && src[i] != 0; i++)
dst[i ^ 1] = src[i];
for ( ; i < field_size_in_words * 2; i++)
dst[i ^ 1] = ' ';
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index b27d5940e5c..94d5ed5ef27 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -123,7 +123,7 @@ static char select_game_buffer[40];
static const game_driver *select_game_list[VISIBLE_GAMES_IN_LIST];
static const game_driver **select_game_driver_list;
-static dip_descriptor dip_switch_model[MAX_PHYSICAL_DIPS];
+static dip_descriptor dip_switch_model[MAX_PHYSICAL_DIPS + 1];
static bitmap_t *hilight_bitmap;
static render_texture *hilight_texture;
@@ -227,10 +227,10 @@ INLINE const char *CLIB_DECL ATTR_PRINTF(1,2) menu_string_pool_add(const char *f
INLINE int get_num_dips(void)
{
- int num = 0;
-
- while (dip_switch_model[num].dip_name != NULL && num < MAX_PHYSICAL_DIPS)
- num++;
+ int num;
+ for (num = 0; num < MAX_PHYSICAL_DIPS; num++)
+ if (dip_switch_model[num].dip_name == NULL)
+ break;
return num;
}
diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c
index b1a9d2d0947..1aaa382d032 100644
--- a/src/mame/machine/seicop.c
+++ b/src/mame/machine/seicop.c
@@ -145,7 +145,7 @@ void copd2_set_tabledata(UINT16 data, running_machine *machine)
/*Movement protection*//*Legionnaire,Heated Barrel*/
-static UINT32 cop_register[5];
+static UINT32 cop_register[6];
/*Sprite DMA protection*//*SD Gundam*/
static UINT8 dma_status;
static UINT32 dma_src;