From: dirk Date: Tue, 16 Dec 2014 19:56:13 +0000 (+0000) Subject: Fixed duplicate compare. X-Git-Tag: 7.0.1-0~1613 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0dedd8a238827ee137f219eae28f1fd4a27cca3;p=imagemagick Fixed duplicate compare. --- diff --git a/MagickCore/color.c b/MagickCore/color.c index 1bf2d4813..8e46550e3 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -1254,11 +1254,15 @@ static int ColorInfoCompare(const void *x,const void *y) **p, **q; + int + cmp; + p=(const ColorInfo **) x, q=(const ColorInfo **) y; - if (LocaleCompare((*p)->path,(*q)->path) == 0) + cmp=LocaleCompare((*p)->path,(*q)->path); + if (cmp == 0) return(LocaleCompare((*p)->name,(*q)->name)); - return(LocaleCompare((*p)->path,(*q)->path)); + return(cmp); } #if defined(__cplusplus) || defined(c_plusplus) diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c index bb0402775..14ee2562c 100644 --- a/MagickCore/delegate.c +++ b/MagickCore/delegate.c @@ -708,9 +708,13 @@ static int DelegateInfoCompare(const void *x,const void *y) **p, **q; + int + cmp; + p=(const DelegateInfo **) x, q=(const DelegateInfo **) y; - if (LocaleCompare((*p)->path,(*q)->path) == 0) + cmp=LocaleCompare((*p)->path,(*q)->path); + if (cmp == 0) { if ((*p)->decode == (char *) NULL) if (((*p)->encode != (char *) NULL) && @@ -720,7 +724,7 @@ static int DelegateInfoCompare(const void *x,const void *y) ((*q)->decode != (char *) NULL)) return(strcmp((*p)->decode,(*q)->decode)); } - return(LocaleCompare((*p)->path,(*q)->path)); + return(cmp); } #if defined(__cplusplus) || defined(c_plusplus)