[geocode-glib] lib: Fix long/lat parsing in some locales



commit 5eeedb32550d6b289242c35be9ceaca963ba07bf
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Nov 25 01:03:05 2012 +0100

    lib: Fix long/lat parsing in some locales
    
    Fix parsing of the results when "." isn't the radix character

 geocode-glib/geocode-forward.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/geocode-glib/geocode-forward.c b/geocode-glib/geocode-forward.c
index 111e467..48dc704 100644
--- a/geocode-glib/geocode-forward.c
+++ b/geocode-glib/geocode-forward.c
@@ -109,8 +109,8 @@ _geocode_parse_single_result_json (const char  *contents,
 	if (ht == NULL)
 		return NULL;
 
-	longitude = strtod (g_hash_table_lookup (ht, "longitude"), NULL);
-	latitude = strtod (g_hash_table_lookup (ht, "latitude"), NULL);
+	longitude = g_ascii_strtod (g_hash_table_lookup (ht, "longitude"), NULL);
+	latitude = g_ascii_strtod (g_hash_table_lookup (ht, "latitude"), NULL);
 	loc = geocode_location_new (longitude, latitude);
 
 	ret = g_list_append (NULL, loc);
@@ -634,8 +634,8 @@ create_description_from_attrs (GHashTable *ht,
 			       gdouble    *longitude,
 			       gdouble    *latitude)
 {
-	*longitude = strtod (g_hash_table_lookup (ht, "longitude"), NULL);
-	*latitude = strtod (g_hash_table_lookup (ht, "latitude"), NULL);
+	*longitude = g_ascii_strtod (g_hash_table_lookup (ht, "longitude"), NULL);
+	*latitude = g_ascii_strtod (g_hash_table_lookup (ht, "latitude"), NULL);
 	return g_strdup (g_hash_table_lookup (ht, "name"));
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]