From: Matthew Fernandez Date: Sun, 4 Jul 2021 04:09:18 +0000 (-0700) Subject: take a const pointer in agstrbind X-Git-Tag: 2.49.0~58^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfbdeae186fac2a45247761d61e03248d060a13b;p=graphviz take a const pointer in agstrbind 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 1e91f4a0f..d1687e9bb 100644 --- a/lib/cgraph/cgraph.h +++ b/lib/cgraph/cgraph.h @@ -305,7 +305,7 @@ CGRAPH_API int agobjkind(void *); CGRAPH_API char *agstrdup(Agraph_t *, const char *); CGRAPH_API char *agstrdup_html(Agraph_t *, const char *); CGRAPH_API int aghtmlstr(const char *); -CGRAPH_API char *agstrbind(Agraph_t * g, char *); +CGRAPH_API char *agstrbind(Agraph_t * g, const char *); CGRAPH_API int agstrfree(Agraph_t *, char *); CGRAPH_API char *agcanon(char *, int); CGRAPH_API char *agstrcanon(char *, char *); diff --git a/lib/cgraph/refstr.c b/lib/cgraph/refstr.c index a53461822..db14202bf 100644 --- a/lib/cgraph/refstr.c +++ b/lib/cgraph/refstr.c @@ -89,7 +89,7 @@ static char *refstrbind(Dict_t * strdict, const char *s) return NULL; } -char *agstrbind(Agraph_t * g, char *s) +char *agstrbind(Agraph_t * g, const char *s) { return refstrbind(refdict(g), s); }