diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 6325c7bd60..860982b650 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -209,6 +209,10 @@ public: // Seconds in timestamps void checkAndCutOffDateWithSec(std::string& time_str) { + if (time_str.size() < 10) // not enough space for a date + { + return; + } // Cuts off the "%Y/%m/%d" from string for todays timestamps. // Assume that passed string has at least "%H:%M:%S" time format. date log_date(not_a_date_time); @@ -225,20 +229,12 @@ public: if ( days_alive == zero_days ) { - // Yep, today's so strip "%Y/%m/%d" info - ptime stripped_time(not_a_date_time); - - mTimeSecStream.str(LLStringUtil::null); - mTimeSecStream << time_str; - mTimeSecStream >> stripped_time; - mTimeSecStream.clear(); - - time_str.clear(); - - mTimeSecStream.str(LLStringUtil::null); - mTimeSecStream << stripped_time; - mTimeSecStream >> time_str; - mTimeSecStream.clear(); + size_t pos = time_str.find_first_of(' '); + if (pos != std::string::npos) + { + time_str.erase(0, pos + 1); + LLStringUtil::trim(time_str); + } } LL_DEBUGS("LLChatLogParser")