From f0c295b2d33d3113c4d7eb28c7ee72da5b9dafad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 12 Apr 2023 22:36:10 +0200 Subject: [PATCH] Add length check in `AppendTextContainer` Allow `Length` parameter to be longer than maximum string length. --- src/engine/client/text.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index 66d5da2fb..95f56f13d 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -1046,6 +1046,8 @@ public: // string length if(Length < 0) Length = str_length(pText); + else + Length = minimum(Length, str_length(pText)); const float Scale = 1.0f / pSizeData->m_FontSize;