From: cristy Date: Wed, 5 May 2010 01:21:43 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9561 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cfef62c1ec8baa62bffd189702e439ecf368ed34;p=imagemagick --- diff --git a/coders/cin.c b/coders/cin.c index 26442fc3a..227f5f843 100644 --- a/coders/cin.c +++ b/coders/cin.c @@ -631,15 +631,15 @@ static Image *ReadCINImage(const ImageInfo *image_info, */ cin.film.id=ReadBlobByte(image); offset++; - if ((unsigned long) cin.film.id != ~0UL) + if (((unsigned long) cin.film.id) != ~0UL) (void) FormatImageProperty(image,"cin:film.id","%d",cin.film.id); cin.film.type=ReadBlobByte(image); offset++; - if ((unsigned long) cin.film.type != ~0UL) + if (((unsigned long) cin.film.type) != ~0UL) (void) FormatImageProperty(image,"cin:film.type","%d",cin.film.type); cin.film.offset=ReadBlobByte(image); offset++; - if ((unsigned long) cin.film.offset != ~0UL) + if (((unsigned long) cin.film.offset) != ~0UL) (void) FormatImageProperty(image,"cin:film.offset","%d", cin.film.offset); cin.film.reserve1=ReadBlobByte(image); diff --git a/magick/geometry.c b/magick/geometry.c index 1ea9218a8..7c1175651 100644 --- a/magick/geometry.c +++ b/magick/geometry.c @@ -112,7 +112,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,long *x,long *y, (void) CopyMagickString(p,p+1,MaxTextExtent); continue; } - switch (*p) + switch ((int) *p) { case '%': { @@ -191,7 +191,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,long *x,long *y, value=strtod(p,&q); if (LocaleNCompare(p,"0x",2) == 0) value=(double) strtol(p,&q,10); - if (((int) *q == -41) || (*q == 'x') || (*q == 'X') || (*q == '\0')) + if ((((int) *q) == -41) || (*q == 'x') || (*q == 'X') || (*q == '\0')) { /* Parse width. @@ -204,7 +204,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,long *x,long *y, if (p != q) flags|=WidthValue; } - if (((int) *p == -41) || (*p == 'x') || (*p == 'X')) + if ((((int) *p) == -41) || (*p == 'x') || (*p == 'X')) { p++; if ((*p != '+') && (*p != '-')) @@ -732,7 +732,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, (void) CopyMagickString(p,p+1,MaxTextExtent); continue; } - switch (*p) + switch ((int) *p) { case '%': { @@ -818,7 +818,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, value=strtod(p,&q); if (LocaleNCompare(p,"0x",2) == 0) value=(double) strtol(p,&q,10); - if (((int) *q == -41) || (*q == 'x') || (*q == 'X') || (*q == ',') || + if ((((int) *q) == -41) || (*q == 'x') || (*q == 'X') || (*q == ',') || (*q == '/') || (*q == ':') || (*q =='\0')) { /* @@ -836,7 +836,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, } } q=p; - if (((int) *p == -41) || (*p == 'x') || (*p == 'X') || (*p == ',') || + if ((((int) *p) == -41) || (*p == 'x') || (*p == 'X') || (*p == ',') || (*p == '/') || (*p == ':')) { /* @@ -845,7 +845,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry, p++; while (isspace((int) ((unsigned char) *p)) != 0) p++; - if ((((int) *q != -41) && (*q != 'x') && (*q != 'X')) || + if (((((int) *q) != -41) && (*q != 'x') && (*q != 'X')) || ((*p != '+') && (*p != '-'))) { q=p; diff --git a/magick/utility.c b/magick/utility.c index aa93c3d4b..e6a128ab6 100644 --- a/magick/utility.c +++ b/magick/utility.c @@ -822,7 +822,7 @@ MagickExport MagickBooleanType ExpandFilenames(int *number_arguments, MaxTextExtent); (void) ConcatenateMagickString(filename,filelist[j],MaxTextExtent); filelist[j]=DestroyString(filelist[j]); - if (strlen(filename) >= MaxTextExtent) + if (strlen(filename) >= (MaxTextExtent-1)) ThrowFatalException(OptionFatalError,"FilenameTruncated"); if (IsPathDirectory(filename) <= 0) { diff --git a/magick/xml-tree.c b/magick/xml-tree.c index f197d39aa..cd7fb235c 100644 --- a/magick/xml-tree.c +++ b/magick/xml-tree.c @@ -1767,7 +1767,7 @@ MagickExport XMLTreeInfo *NewXMLTree(const char *xml,ExceptionInfo *exception) attributes=(char **) sentinel; tag=p; if ((isalpha((int) ((unsigned char) *p)) !=0) || (*p == '_') || - (*p == ':') || (*p < '\0')) + (*p == ':') || (((int) *p) < '\0')) { /* Tag.