gst/apetag/gstapedemux.c: Use g_strtod() instead of sscanf to parse doubles, so that...
authorSebastian Dröge <mail@slomosnail.de>
Wed, 6 Dec 2006 13:16:59 +0000 (13:16 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Wed, 6 Dec 2006 13:16:59 +0000 (13:16 +0000)
Original commit message from CVS:
* gst/apetag/gstapedemux.c: (ape_demux_parse_tags):
Use g_strtod() instead of sscanf to parse doubles, so that it will
try parsing in the C locale if the current locale fails.
Fixes: #382982
Patch by: Sebastian Dröge  <mail at slomosnail de >

ChangeLog
gst/apetag/gstapedemux.c

index c283c6626b0ac3f8375d81d60229e0ff553cc97d..7f2f597026678e1019fc758745a93f139f619e91 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-12-06  Jan Schmidt  <thaytan@mad.scientist.com>
+
+       * gst/apetag/gstapedemux.c: (ape_demux_parse_tags):
+       Use g_strtod() instead of sscanf to parse doubles, so that it will
+       try parsing in the C locale if the current locale fails.
+       Fixes: #382982
+       Patch by: Sebastian Dröge  <mail at slomosnail de >
+
 2006-12-01  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * win32/MANIFEST:
index 6675995b6957847dea3dbda97ff399dae856d662..73f9e467496a31b51a897d6042961a0830a60b17 100644 (file)
@@ -278,11 +278,14 @@ ape_demux_parse_tags (const guint8 * data, gint size)
         }
         case G_TYPE_DOUBLE:{
           gdouble v_double;
+          gchar *endptr;
 
-          if (sscanf (val, "%lf", &v_double) == 1) {
+          v_double = g_strtod (val, &endptr);
+          if (endptr != val) {
             g_value_init (&v, G_TYPE_DOUBLE);
             g_value_set_double (&v, v_double);
           }
+
           break;
         }
         default:{