summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/rendlay.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-06-13 12:32:51 -0400
committer AJR <ajrhacker@users.noreply.github.com>2021-06-13 12:33:34 -0400
commit7b27b93875bb230579bcdd40a7c93a85f0761dba (patch)
tree8abf03662803f92e0ccbf27b1beb033953713a2c /src/emu/rendlay.cpp
parent1482fbabc47cc41e31135bafc6dc27c84b16f4a8 (diff)
rendlay.cpp: Fix assertion failure with -D_GLIBCXX_ASSERTIONS
Diffstat (limited to 'src/emu/rendlay.cpp')
-rw-r--r--src/emu/rendlay.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp
index 789c7c15a7c..00322df4203 100644
--- a/src/emu/rendlay.cpp
+++ b/src/emu/rendlay.cpp
@@ -530,6 +530,7 @@ private:
// variable found
if (start == 0)
m_buffer.seekp(0);
+ assert(start < str.length());
m_buffer.write(&str[start], pos - start);
m_buffer.write(text.first.data(), text.first.length());
start = term - str.begin() + 1;
@@ -550,7 +551,8 @@ private:
}
else
{
- m_buffer.write(&str[start], str.length() - start);
+ if (start < str.length())
+ m_buffer.write(&str[start], str.length() - start);
return util::buf_to_string_view(m_buffer);
}
}