summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar ajrhacker <ajrhacker@users.noreply.github.com>2018-01-20 12:19:40 -0500
committerGravatarGravatar GitHub <noreply@github.com>2018-01-20 12:19:40 -0500
commitaa78e1509239d62e1d3c38298728345e22de7844 (patch) (github)
tree38b89c99d65abfe2fc95a62ca7c82cd2e419f7cd
parent95e425f233e2a69dc47a13b2cadd9858d03d7fdc (diff)
parent1978424daaad95cf98b88eb0b62edbe6029ea0cf (diff)
downloadmame-aa78e1509239d62e1d3c38298728345e22de7844.tar.bz2
mame-aa78e1509239d62e1d3c38298728345e22de7844.zip
Merge pull request #3093 from firewave/coverity_cdp1879
cdp1879.cpp: fixed Coverity out-of-bounds warnings (nw)
-rw-r--r--src/devices/machine/cdp1879.cpp2
-rw-r--r--src/devices/machine/cdp1879.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/machine/cdp1879.cpp b/src/devices/machine/cdp1879.cpp
index c42a6120b4d..6fbc376df28 100644
--- a/src/devices/machine/cdp1879.cpp
+++ b/src/devices/machine/cdp1879.cpp
@@ -70,7 +70,7 @@ void cdp1879_device::device_timer(emu_timer &timer, device_timer_id id, int para
// comparator IRQ
bool new_state = true;
- for (int i = R_CNT_SECONDS; i <= R_CNT_MONTH; i++)
+ for (int i = R_CNT_SECONDS; i <= R_CNT_HOURS; i++)
{
if(m_regs[i] != m_regs[i + 6])
{
diff --git a/src/devices/machine/cdp1879.h b/src/devices/machine/cdp1879.h
index bd87a228b65..ec34704e20f 100644
--- a/src/devices/machine/cdp1879.h
+++ b/src/devices/machine/cdp1879.h
@@ -71,7 +71,7 @@ private:
R_ALM_HOURS
};
- u8 m_regs[10];
+ u8 m_regs[11];
bool m_comparator_state;
// timers