diff options
author | Cinder <cinder@sdf.org> | 2015-04-11 15:23:06 -0600 |
---|---|---|
committer | Cinder <cinder@sdf.org> | 2015-04-11 15:23:06 -0600 |
commit | 5a282abe184323643f1a88f2aba662648059b4e2 (patch) | |
tree | 7812f302365118cb017d71f768cb4583abc24f25 /indra/llcommon | |
parent | 5c6cf3e7fb9f592e3a293921175b64b515bac23f (diff) |
STORM-2113 - uri parsing cleanup and fixes
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/lluriparser.cpp | 11 | ||||
-rw-r--r-- | indra/llcommon/lluriparser.h | 2 |
2 files changed, 8 insertions, 5 deletions
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<std::string::size_type>(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); |