diff --git a/src/engine/interface/console.cpp b/src/engine/interface/console.cpp index 8ba87b3d7..4da47af7a 100644 --- a/src/engine/interface/console.cpp +++ b/src/engine/interface/console.cpp @@ -447,9 +447,12 @@ namespace return; } size_t cblen = std::strlen(cb), - commandlen = std::strlen(commandbuf), - decoded = decodeutf8(reinterpret_cast(&commandbuf[commandlen]), sizeof(commandbuf)-1-commandlen, reinterpret_cast(cb), cblen); - commandbuf[commandlen + decoded] = '\0'; + commandlen = std::strlen(commandbuf); + if(strlen(commandbuf) + cblen < 260) + { + std::memcpy(reinterpret_cast(&commandbuf[commandlen]), cb, cblen); + } + commandbuf[commandlen + cblen] = '\0'; SDL_free(cb); }