]> granicus.if.org Git - graphviz/commitdiff
take a const pointer in agstrdup_html
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 4 Jul 2021 03:55:21 +0000 (20:55 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 18 Jul 2021 00:31:34 +0000 (17:31 -0700)
This function does not modify its string argument, so it is more accurate to
qualify it as const. Related to #634.

lib/cgraph/cgraph.h
lib/cgraph/refstr.c

index e2ea7f4ea56cb866f547d683ae5be548c041a535..9526ee3050721379d2b20f3f04edb1c37dfdf467 100644 (file)
@@ -303,7 +303,7 @@ CGRAPH_API int agobjkind(void *);
 
 /* strings */
 CGRAPH_API char *agstrdup(Agraph_t *, const char *);
-CGRAPH_API char *agstrdup_html(Agraph_t *, char *);
+CGRAPH_API char *agstrdup_html(Agraph_t *, const char *);
 CGRAPH_API int aghtmlstr(char *);
 CGRAPH_API char *agstrbind(Agraph_t * g, char *);
 CGRAPH_API int agstrfree(Agraph_t *, char *);
index 0c73fb120b2518e0b45762d36cd70c5112af5756..e73c8cced38b5f3ae3a8d2be25848f23279ce813 100644 (file)
@@ -121,7 +121,7 @@ char *agstrdup(Agraph_t * g, const char *s)
     return r->s;
 }
 
-char *agstrdup_html(Agraph_t * g, char *s)
+char *agstrdup_html(Agraph_t * g, const char *s)
 {
     refstr_t *r;
     Dict_t *strdict;