From: cristy Date: Tue, 6 Sep 2011 14:40:59 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7065 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f30f47df26a3583363ce2bae4c2aec8aec2a66bb;hp=bec6f59c622d2d808d788211357e0c62990c98a6;p=imagemagick --- diff --git a/MagickCore/geometry.c b/MagickCore/geometry.c index 01a95cf6f..794abd000 100644 --- a/MagickCore/geometry.c +++ b/MagickCore/geometry.c @@ -93,6 +93,9 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, double value; + int + c; + MagickStatusType flags; @@ -192,7 +195,8 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, (void) value; if (LocaleNCompare(p,"0x",2) == 0) value=(double) strtol(p,&q,10); - if ((((int) *q) == -41) || (*q == 'x') || (*q == 'X') || (*q == '\0')) + c=(*q); + if ((c == -41) || (*q == 'x') || (*q == 'X') || (*q == '\0')) { /* Parse width. @@ -205,7 +209,8 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, if (p != q) flags|=WidthValue; } - if ((((int) *p) == -41) || (*p == 'x') || (*p == 'X')) + c=(*p); + if ((c == -41) || (*p == 'x') || (*p == 'X')) { p++; if ((*p != '+') && (*p != '-')) @@ -747,6 +752,9 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, double value; + int + c; + MagickStatusType flags; @@ -853,7 +861,8 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, value=InterpretLocaleValue(p,&q); if (LocaleNCompare(p,"0x",2) == 0) value=(double) strtol(p,&q,10); - if ((((int) *q) == -41) || (*q == 'x') || (*q == 'X') || (*q == ',') || + c=(*q); + if ((c == -41) || (*q == 'x') || (*q == 'X') || (*q == ',') || (*q == '/') || (*q == ':') || (*q =='\0')) { /* @@ -871,8 +880,9 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, } } q=p; - if ((((int) *p) == -41) || (*p == 'x') || (*p == 'X') || (*p == ',') || - (*p == '/') || (*p == ':')) + c=(*p); + if ((c == -41) || (*p == 'x') || (*p == 'X') || (*p == ',') || (*p == '/') || + (*p == ':')) { /* Parse sigma. @@ -880,8 +890,9 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, p++; while (isspace((int) ((unsigned char) *p)) != 0) p++; - if (((((int) *q) != -41) && (*q != 'x') && (*q != 'X')) || - ((*p != '+') && (*p != '-'))) + c=(*q); + if (((c != -41) && (*q != 'x') && (*q != 'X')) || ((*p != '+') && + (*p != '-'))) { q=p; value=InterpretLocaleValue(p,&p);