aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-05-19 13:42:56 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-05-19 13:44:23 +0200
commit8bf13294819d57468a85a6bd2646b3467932bbb4 (patch)
tree1f7e8720b4a8efd2de3f0065eaf9714706931cd4
parent58ae8f4c2451b5d1110263ffb5f9fa6e3fcdcf03 (diff)
libmm-glib,helpers: use locale-independent strtod()
Otherwise parsing may fail, e.g. as in this unit test: # Start of smoni tests # DEBUG: testing SMONI response: ^SMONI: 2G,71,-61,262,02,0143,83BA,33,33,3,6,G,NOCONN # DEBUG: testing SMONI response: ^SMONI: 2G,SEARCH,SEARCH # DEBUG: testing SMONI response: ^SMONI: 2G,673,-89,262,07,4EED,A500,16,16,7,4,G,5,-107,LIMSRV # DEBUG: testing SMONI response: ^SMONI: 2G,673,-80,262,07,4EED,A500,35,35,7,4,G,643,4,0,-80,0,S_FR # DEBUG: testing SMONI response: ^SMONI: 3G,10564,296,-7.5,-79,262,02,0143,00228FF,-92,-78,NOCONN ** ERROR:cinterion/tests/test-modem-helpers-cinterion.c:1036:test_smoni_response: assertion failed (fabs (ecn0 - smoni_response_tests[i].ecn0) < 0.1): (0,5 < 0,1) Bail out! ERROR:cinterion/tests/test-modem-helpers-cinterion.c:1036:test_smoni_response: assertion failed (fabs (ecn0 - smoni_response_tests[i].ecn0) < 0.1): (0,5 < 0,1) Aborted (core dumped)
-rw-r--r--libmm-glib/mm-common-helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c
index d2c54a1c..da1cc1cc 100644
--- a/libmm-glib/mm-common-helpers.c
+++ b/libmm-glib/mm-common-helpers.c
@@ -1565,7 +1565,7 @@ mm_get_double_from_str (const gchar *str,
return FALSE;
errno = 0;
- num = strtod (str, NULL);
+ num = g_ascii_strtod (str, NULL);
if (!errno) {
*out = num;
return TRUE;