mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-31 02:19:09 +00:00
Fix #11644: Off by one error in StrMakeValid buffer last character
This commit is contained in:
@@ -211,8 +211,10 @@ void StrMakeValidInPlace(char *str, StringValidationSettings settings)
|
||||
*/
|
||||
std::string StrMakeValid(std::string_view str, StringValidationSettings settings)
|
||||
{
|
||||
if (str.empty()) return {};
|
||||
|
||||
auto buf = str.data();
|
||||
auto last = buf + str.size();
|
||||
auto last = buf + str.size() - 1;
|
||||
|
||||
std::ostringstream dst;
|
||||
std::ostreambuf_iterator<char> dst_iter(dst);
|
||||
|
Reference in New Issue
Block a user