Corrected a problem with strmid()

master
Tomasz Kapuściński 2015-05-22 20:34:35 +02:00
parent fa67e815b8
commit 55b4e73a7a
1 changed files with 2 additions and 0 deletions

View File

@ -306,6 +306,8 @@ CBotString CBotString::Mid(int start, int lg)
{
CBotString res;
if (lg == -1) lg = 2000;
// clamp start to correct value
if (start < 0) start = 0;
if (start >= m_lg) return res;