]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 6 Sep 2011 20:33:35 +0000 (20:33 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 6 Sep 2011 20:33:35 +0000 (20:33 +0000)
MagickCore/geometry.c

index 794abd000ec4b54b4b83021981bc2230cb742de1..4037d5c1d8b1d7cafd832902e7773065cdf8eff0 100644 (file)
@@ -115,7 +115,8 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x,
         (void) CopyMagickString(p,p+1,MaxTextExtent);
         continue;
       }
-    switch ((int) *p)
+    c=(int) ((unsigned int) *p);
+    switch (c)
     {
       case '%':
       {
@@ -173,9 +174,9 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x,
       case '7':
       case '8':
       case '9':
-      case -41:
       case 'x':
       case 'X':
+      case 215:
       {
         p++;
         break;
@@ -195,8 +196,8 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x,
   (void) value;
   if (LocaleNCompare(p,"0x",2) == 0)
     value=(double) strtol(p,&q,10);
-  c=(*q);
-  if ((c == -41) || (*q == 'x') || (*q == 'X') || (*q == '\0'))
+  c=(int) ((unsigned char) *q);
+  if ((c == 215) || (*q == 'x') || (*q == 'X') || (*q == '\0'))
     {
       /*
         Parse width.
@@ -210,7 +211,8 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x,
         flags|=WidthValue;
     }
   c=(*p);
-  if ((c == -41) || (*p == 'x') || (*p == 'X'))
+  c=(int) ((unsigned char) *p);
+  if ((c == 215) || (*p == 'x') || (*p == 'X'))
     {
       p++;
       if ((*p != '+') && (*p != '-'))
@@ -832,11 +834,11 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
       case '7':
       case '8':
       case '9':
-      case -41:
       case 'x':
       case 'X':
       case '/':
       case ':':
+      case 215:
       {
         p++;
         break;
@@ -861,8 +863,8 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
   value=InterpretLocaleValue(p,&q);
   if (LocaleNCompare(p,"0x",2) == 0)
     value=(double) strtol(p,&q,10);
-  c=(*q);
-  if ((c == -41) || (*q == 'x') || (*q == 'X') || (*q == ',') ||
+  c=(int) ((unsigned char) *q);
+  if ((c == 215) || (*q == 'x') || (*q == 'X') || (*q == ',') ||
       (*q == '/') || (*q == ':') || (*q =='\0'))
     {
       /*
@@ -880,8 +882,8 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
         }
     }
   q=p;
-  c=(*p);
-  if ((c == -41) || (*p == 'x') || (*p == 'X') || (*p == ',') || (*p == '/') ||
+  c=(int) ((unsigned char) *p);
+  if ((c == 215) || (*p == 'x') || (*p == 'X') || (*p == ',') || (*p == '/') ||
       (*p == ':'))
     {
       /*
@@ -890,8 +892,8 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
       p++;
       while (isspace((int) ((unsigned char) *p)) != 0)
         p++;
-      c=(*q);
-      if (((c != -41) && (*q != 'x') && (*q != 'X')) || ((*p != '+') &&
+      c=(int) ((unsigned char) *q);
+      if (((c != 215) && (*q != 'x') && (*q != 'X')) || ((*p != '+') &&
           (*p != '-')))
         {
           q=p;