diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-08-17 15:11:14 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-08-17 15:11:14 -0700 |
commit | 9944127a391fd15a1a0b0d30d736f2cec105039c (patch) | |
tree | 292eb44178986035dc7931d1458396d0d53dfc98 /indra/llcommon | |
parent | 3676469b72a3f677e2048b5117e4a81897244dc7 (diff) | |
parent | a666878a011b9b1e8ebb922b42e1b300c7d2cc99 (diff) |
Merge from viewer-experience
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llsdserialize_xml.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index d8213c4477..bf216d41bf 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -720,6 +720,7 @@ void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name) case ELEMENT_INTEGER: { S32 i; + // sscanf okay here with different locales - ints don't change for different locale settings like floats do. if ( sscanf(mCurrentContent.c_str(), "%d", &i ) == 1 ) { // See if sscanf works - it's faster value = i; @@ -733,15 +734,19 @@ void LLSDXMLParser::Impl::endElementHandler(const XML_Char* name) case ELEMENT_REAL: { - F64 r; - if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 ) - { // See if sscanf works - it's faster - value = r; - } - else - { - value = LLSD(mCurrentContent).asReal(); - } + value = LLSD(mCurrentContent).asReal(); + // removed since this breaks when locale has decimal separator that isn't '.' + // investigated changing local to something compatible each time but deemed higher + // risk that just using LLSD.asReal() each time. + //F64 r; + //if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 ) + //{ // See if sscanf works - it's faster + // value = r; + //} + //else + //{ + // value = LLSD(mCurrentContent).asReal(); + //} } break; |