[Magick-bugs] GetMagickToken() and locales that use ", " as radix character

emagick at magic.ms emagick at magic.ms
Thu Jan 8 09:56:11 PST 2009


For instance, an attempt to draw "rectangle 10,20 30,40" while the German
locale is active results in exception NonconformingDrawingPrimitiveDefinition
as "10,20" and "30,40" are parsed as two decimal numbers 10.2 and 30.4,
respectively, instead of four decimal numbers.

Here's a patch.

--- token.c	24 Sep 2007 12:24:54 -0000	1.1.1.2
+++ token.c	8 Jan 2009 17:44:24 -0000	1.2
@@ -222,9 +222,9 @@
            *q;

          (void) strtod(p,&q);
-        if (p != q)
+        if (p != q && *p != ',')
            {
-            for ( ; p < q; p++)
+            for ( ; p < q && *p != ','; p++)
                token[i++]=(*p);
              if (*p == '%')
                token[i++]=(*p++);



More information about the Magick-bugs mailing list