summaryrefslogtreecommitdiff
path: root/indra/llcommon/lluriparser.cpp
diff options
context:
space:
mode:
authorCinder <cinder@sdf.org>2015-04-11 15:23:06 -0600
committerCinder <cinder@sdf.org>2015-04-11 15:23:06 -0600
commit5a282abe184323643f1a88f2aba662648059b4e2 (patch)
tree7812f302365118cb017d71f768cb4583abc24f25 /indra/llcommon/lluriparser.cpp
parent5c6cf3e7fb9f592e3a293921175b64b515bac23f (diff)
STORM-2113 - uri parsing cleanup and fixes
Diffstat (limited to 'indra/llcommon/lluriparser.cpp')
-rw-r--r--indra/llcommon/lluriparser.cpp11
1 files changed, 7 insertions, 4 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;
}
}