]> granicus.if.org Git - graphviz/commitdiff
xml_isentity: take a const pointer instead of a mutable one
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Oct 2021 01:10:14 +0000 (18:10 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 8 Oct 2021 14:41:48 +0000 (07:41 -0700)
This function does not modify the pointed to data of its parameter, and this
will simplify some upcoming changes.

Related to #1868.

lib/common/xml.c

index bafae5d1ff42c4baefa3d335174535f760fdf910..064e2fab303fcd2899dd27098052b0cb156963d0 100644 (file)
@@ -17,7 +17,7 @@ static bool isalpha_no_locale(char c) {
  *                          or &#[0-9]*;        (e.g. &#38; )
  *                          or &#x[0-9a-fA-F]*; (e.g. &#x6C34; )
  */
-static int xml_isentity(char *s)
+static int xml_isentity(const char *s)
 {
     s++;                       /* already known to be '&' */
     if (*s == ';') { // '&;' is not a valid entity