]> git.lizzy.rs Git - minetest.git/commit
Fix ChatPrompt crash in very narrow windows (#13305)
authorDS <ds.desour@proton.me>
Sat, 11 Mar 2023 16:46:49 +0000 (17:46 +0100)
committerGitHub <noreply@github.com>
Sat, 11 Mar 2023 16:46:49 +0000 (17:46 +0100)
commitb1ed0ef721d1ef59e7266fbf975f4d2e33b44041
tree3e7eea444fb734e4a08fd9d14153ca94125b5cce
parent1aeb0280df208a32f22b637f0aa6e9b01c451a31
Fix ChatPrompt crash in very narrow windows (#13305)

In very narrow windows, `m_cols` can be small (i.e. 0).
Hence, `m_view <= m_line.size() + 1 - m_cols` does not guarantee
`m_view <= m_line.size()`.
`std::string::substr(pos, npos)` requires `pos <= size()`.
src/chat.cpp