diff --git a/MissionEditor/functions.cpp b/MissionEditor/functions.cpp index 3caeca3..080a5de 100644 --- a/MissionEditor/functions.cpp +++ b/MissionEditor/functions.cpp @@ -508,8 +508,9 @@ void TruncSpace(CString& str) { str.TrimLeft(); str.TrimRight(); - if (str.Find(" ") >= 0) { - str.Delete(str.Find(" "), str.GetLength() - str.Find(" ")); + auto const spacePos = str.Find(" "); + if (spacePos >= 0) { + str.Delete(spacePos, str.GetLength() - spacePos); } }