Fix crash showing a layer name with " : " on the status bar

Bug reported here:
http://steamcommunity.com/app/431730/discussions/2/133262487502331720/
This commit is contained in:
David Capello 2017-04-17 09:36:09 -03:00
parent 73999c5415
commit 6829b3d5a0

View File

@ -322,7 +322,7 @@ public:
break; break;
} }
if (*(j+1) == 0 || *(j+1) == ' ') { if (*j == ':' && (*(j+1) == 0 || *(j+1) == ' ')) {
if (i != text) { if (i != text) {
// Here i is ':' and i-1 is a whitespace ' ' // Here i is ':' and i-1 is a whitespace ' '
m_indicators->addTextIndicator(std::string(text, i-1).c_str()); m_indicators->addTextIndicator(std::string(text, i-1).c_str());
@ -334,6 +334,8 @@ public:
text = i = (*(j+1) == ' ' ? j+2: j+1); text = i = (*(j+1) == ' ' ? j+2: j+1);
} }
else
i = j;
} }
else else
++i; ++i;