summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/cheat.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-08-15 21:29:39 -0400
committer AJR <ajrhacker@users.noreply.github.com>2021-08-15 21:32:53 -0400
commit0298e5d6c376f5df0cefe1b9a84840eba39f0ebc (patch)
tree719da5f05bade2379610254ce842e0896ed0bd71 /src/frontend/mame/cheat.cpp
parent08a0e5af5be40da3b97302d85961f32ddee2bd54 (diff)
Use std::clamp in more source files
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;