Bug 950986 - Use ToDouble() to convert version to a double independent of locale. r=dougt, a=lsblakk
authorMarina Samuel <msamuel@mozilla.com>
Wed, 08 Jan 2014 12:22:24 -0500
changeset 169285 31db6a06fc521b0558d0cc834604f409764c7493
parent 169284 0032a5a180ff737ecd9a704f00cd71b79fef7b13
child 169286 1f6eaab92cb98210ae1fb233856ef673821b4bf1
push id4965
push userryanvm@gmail.com
push dateThu, 16 Jan 2014 15:43:24 +0000
treeherdermozilla-aurora@cb1622bda208 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt, lsblakk
bugs950986
milestone28.0a2
Bug 950986 - Use ToDouble() to convert version to a double independent of locale. r=dougt, a=lsblakk
xpcom/base/nsSystemInfo.cpp
--- a/xpcom/base/nsSystemInfo.cpp
+++ b/xpcom/base/nsSystemInfo.cpp
@@ -176,17 +176,18 @@ nsSystemInfo::Init()
       }
     }
 
 #if defined(XP_WIN) && defined(MOZ_METRO)
     // Create "hasWindowsTouchInterface" property.
     nsAutoString version;
     rv = GetPropertyAsAString(NS_LITERAL_STRING("version"), version);
     NS_ENSURE_SUCCESS(rv, rv);
-    double versionDouble = atof(NS_ConvertUTF16toUTF8(version).get());
+    double versionDouble = version.ToDouble(&rv);
+    NS_ENSURE_SUCCESS(rv, rv);
 
     rv = SetPropertyAsBool(NS_ConvertASCIItoUTF16("hasWindowsTouchInterface"),
       versionDouble >= 6.2);
     NS_ENSURE_SUCCESS(rv, rv);
 #else
     rv = SetPropertyAsBool(NS_ConvertASCIItoUTF16("hasWindowsTouchInterface"), false);
     NS_ENSURE_SUCCESS(rv, rv);
 #endif