From 5a282abe184323643f1a88f2aba662648059b4e2 Mon Sep 17 00:00:00 2001 From: Cinder Date: Sat, 11 Apr 2015 15:23:06 -0600 Subject: STORM-2113 - uri parsing cleanup and fixes --- indra/llcommon/lluriparser.cpp | 11 +++++++---- indra/llcommon/lluriparser.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index ef4481d32f..0ff6657b87 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -118,11 +118,14 @@ void LLUriParser::fragment(const std::string& s) void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str) { - S32 len = textRange.afterLast - textRange.first; - if (len) + if (textRange.first != NULL && textRange.afterLast != NULL && textRange.first < textRange.afterLast) { - str = textRange.first; - str = str.substr(0, len); + const ptrdiff_t len = textRange.afterLast - textRange.first; + str.assign(textRange.first, static_cast(len)); + } + else + { + str = LLStringUtil::null; } } diff --git a/indra/llcommon/lluriparser.h b/indra/llcommon/lluriparser.h index 719f916837..3e7a5c2a57 100644 --- a/indra/llcommon/lluriparser.h +++ b/indra/llcommon/lluriparser.h @@ -36,7 +36,7 @@ class LL_COMMON_API LLUriParser { public: LLUriParser(const std::string& u); - virtual ~LLUriParser(); + ~LLUriParser(); const char * scheme() const; void sheme (const std::string& s); -- cgit v1.2.3