From: Matthew Fernandez Date: Sat, 2 Oct 2021 00:16:56 +0000 (-0700) Subject: xml_isentity: use ctype.h functions for readability X-Git-Tag: 2.49.2~19^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6e35bd4ea4992911b411a4779d69d0be8630ed2;p=graphviz xml_isentity: use ctype.h functions for readability This has no functional impact, but just makes the code simpler to read and less error prone. --- diff --git a/lib/common/xml.c b/lib/common/xml.c index 100c6a9d4..0d19c610b 100644 --- a/lib/common/xml.c +++ b/lib/common/xml.c @@ -1,6 +1,7 @@ #include #include #include +#include /* return true if *s points to &[A-Za-z]+; (e.g. Ç ) * or &#[0-9]*; (e.g. & ) @@ -16,12 +17,10 @@ static int xml_isentity(char *s) s++; if (*s == 'x' || *s == 'X') { s++; - while ((*s >= '0' && *s <= '9') - || (*s >= 'a' && *s <= 'f') - || (*s >= 'A' && *s <= 'F')) + while (isxdigit(*s)) s++; } else { - while (*s >= '0' && *s <= '9') + while (isdigit(*s)) s++; } } else {