diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llallocator_heap_profile.cpp | 31 | ||||
-rw-r--r-- | indra/llcommon/lldate.cpp | 3 | ||||
-rw-r--r-- | indra/llcommon/llprocessor.cpp | 3 | ||||
-rw-r--r-- | indra/llcommon/llstring.h | 1 | ||||
-rw-r--r-- | indra/llcommon/lluri.cpp | 15 |
5 files changed, 35 insertions, 18 deletions
diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index 0a807702d0..e50d59fd4b 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -113,21 +113,24 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text) ++j; while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens - llassert_always(j != line_elems.end()); - ++j; // skip the '@' - - mLines.push_back(line(live_count, live_size, tot_count, tot_size)); - line & current_line = mLines.back(); - - for(; j != line_elems.end(); ++j) - { - if(!j->empty()) { - U32 marker = boost::lexical_cast<U32>(*j); - current_line.mTrace.push_back(marker); - } - } + llassert(j != line_elems.end()); + if (j != line_elems.end()) + { + ++j; // skip the '@' + + mLines.push_back(line(live_count, live_size, tot_count, tot_size)); + line & current_line = mLines.back(); + + for(; j != line_elems.end(); ++j) + { + if(!j->empty()) + { + U32 marker = boost::lexical_cast<U32>(*j); + current_line.mTrace.push_back(marker); + } + } + } } - // *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it } diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index ca7e471bf2..de7f2ead74 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -152,7 +152,8 @@ void LLDate::toStream(std::ostream& s) const s << '.' << std::setw(2) << (int)(exp_time.tm_usec / (LL_APR_USEC_PER_SEC / 100)); } - s << 'Z'; + s << 'Z' + << std::setfill(' '); } bool LLDate::split(S32 *year, S32 *month, S32 *day, S32 *hour, S32 *min, S32 *sec) const diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 469e544b16..8a4a4a8f9a 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -281,7 +281,8 @@ bool CProcessor::AnalyzeIntelProcessor() // already have a string here from GetCPUInfo(). JC if ( CPUInfo.uiBrandID < LL_ARRAY_SIZE(INTEL_BRAND) ) { - strcpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID]); + strncpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID], sizeof(CPUInfo.strBrandID)-1); + CPUInfo.strBrandID[sizeof(CPUInfo.strBrandID)-1]='\0'; if (CPUInfo.uiBrandID == 3 && CPUInfo.uiModel == 6) { diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 31e70e0fe4..62cedcde4e 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -882,6 +882,7 @@ void LLStringUtilBase<T>::addCRLF(std::basic_string<T>& string) } string.assign(t, size); + delete[] t; } } diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index f6e8f01f0e..9d4f3a98f0 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -46,10 +46,21 @@ void encode_character(std::ostream& ostr, std::string::value_type val) { - ostr << "%" << std::uppercase << std::hex << std::setw(2) << std::setfill('0') + ostr << "%" + + << std::uppercase + << std::hex + << std::setw(2) + << std::setfill('0') + // VWR-4010 Cannot cast to U32 because sign-extension on // chars > 128 will result in FFFFFFC3 instead of F3. - << static_cast<S32>(static_cast<U8>(val)); + << static_cast<S32>(static_cast<U8>(val)) + + // reset stream state + << std::nouppercase + << std::dec + << std::setfill(' '); } // static |