diff --git a/MagickCore/xml-tree.c b/MagickCore/xml-tree.c
index 3452ebd..971b397 100644
--- a/MagickCore/xml-tree.c
+++ b/MagickCore/xml-tree.c
@@ -1383,7 +1383,7 @@
       return(MagickFalse);
     i=0;
     while ((entities[i] != (char *) NULL) &&
-           (strncmp(entities[i],xml+1,strlen(entities[i]) == 0)))
+           (strncmp(entities[i],xml+1,strlen(entities[i])) == 0))
       i+=2;
     if ((entities[i] != (char *) NULL) &&
         (ValidateEntities(tag,entities[i+1],entities) == 0))