From: Matthew Fernandez Date: Sun, 4 Jul 2021 03:55:21 +0000 (-0700) Subject: take a const pointer in agstrdup_html X-Git-Tag: 2.49.0~58^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b63067a178c118520ad34afcc83a7eec0ae67019;p=graphviz take a const pointer in agstrdup_html This function does not modify its string argument, so it is more accurate to qualify it as const. Related to #634. --- diff --git a/lib/cgraph/cgraph.h b/lib/cgraph/cgraph.h index e2ea7f4ea..9526ee305 100644 --- a/lib/cgraph/cgraph.h +++ b/lib/cgraph/cgraph.h @@ -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 *); diff --git a/lib/cgraph/refstr.c b/lib/cgraph/refstr.c index 0c73fb120..e73c8cced 100644 --- a/lib/cgraph/refstr.c +++ b/lib/cgraph/refstr.c @@ -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;