diff options
| author | Richard Nelson <richard@lindenlab.com> | 2011-08-18 14:16:06 -0700 | 
|---|---|---|
| committer | Richard Nelson <richard@lindenlab.com> | 2011-08-18 14:16:06 -0700 | 
| commit | cc4e708848ce0be958353b8aa16d0c41c2a265bb (patch) | |
| tree | 71ef4fa6d4ff60510cf896e8c1667a6ff2e2ba15 /indra/llcommon | |
| parent | 64e3907853f4a2fba6f569b69d08a3f632d046e7 (diff) | |
| parent | e83cb4e9591befc00006c4ef8ac91f4445447042 (diff) | |
merge
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; | 
