From: Cristy Date: Tue, 14 May 2019 00:42:49 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-46~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=909488f04f09314be62c123c5070b7206719ff57;p=imagemagick ... --- diff --git a/coders/meta.c b/coders/meta.c index 209f76b71..2e77186d8 100644 --- a/coders/meta.c +++ b/coders/meta.c @@ -141,17 +141,15 @@ static MagickBooleanType IsMETA(const unsigned char *magick,const size_t length) % */ -typedef struct _html_code +static const struct { - const short int + const unsigned char len; const char - *code, + code[7], val; -} html_code; - -static const html_code html_codes[] = { +} html_codes[] = { #ifdef HANDLE_GT_LT { 4,"<",'<' }, { 4,">",'>' }, @@ -231,7 +229,7 @@ static size_t convertHTMLcodes(char *s) *s=value; return(o); } - for (i=0; i < (ssize_t) (sizeof(html_codes)/sizeof(html_code)); i++) + for (i=0; i < (ssize_t) (sizeof(html_codes)/sizeof(html_codes[0])); i++) { if (html_codes[i].len <= (ssize_t) length) if (stringnicmp(s,html_codes[i].code,(size_t) (html_codes[i].len)) == 0) @@ -1911,7 +1909,7 @@ static int formatIPTC(Image *ifile, Image *ofile) int i, - tagcount = (int) (sizeof(tags) / sizeof(tag_spec)); + tagcount = (int) (sizeof(tags) / sizeof(tags[0])); int c; @@ -2051,7 +2049,7 @@ static int formatIPTCfromBuffer(Image *ofile, char *s, ssize_t len) int i, - tagcount = (int) (sizeof(tags) / sizeof(tag_spec)); + tagcount = (int) (sizeof(tags) / sizeof(tags[0])); int c; diff --git a/coders/xpm.c b/coders/xpm.c index 232ff2df2..ead56ad91 100644 --- a/coders/xpm.c +++ b/coders/xpm.c @@ -191,7 +191,7 @@ static char *ParseXPMColor(char *color,MagickBooleanType search_start) i; static const char - *const targets[NumberTargets] = { "c ", "g ", "g4 ", "m ", "b ", "s " }; + *const targets[NumberTargets][3] = { "c ", "g ", "g4 ", "m ", "b ", "s " }; if (search_start != MagickFalse) {