summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/cheat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/cheat.cpp')
-rw-r--r--src/frontend/mame/cheat.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp
index 61cda1cf475..bc266cc6aae 100644
--- a/src/frontend/mame/cheat.cpp
+++ b/src/frontend/mame/cheat.cpp
@@ -1264,7 +1264,8 @@ std::string &cheat_manager::get_output_string(int row, ui::text_layout::text_jus
row = (row < 0) ? (m_numlines + row) : (row - 1);
// clamp within range
- row = std::min(std::max(row, 0), m_numlines - 1);
+ assert(m_numlines > 0);
+ row = std::clamp(row, 0, m_numlines - 1);
// return the appropriate string
m_justify[row] = justify;