From: Matthew Fernandez Date: Sat, 17 Dec 2022 20:00:39 +0000 (-0800) Subject: gvpr deparse: avoid accessing agxbuf internals X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f88c70aaf4891855a22f075975df722afc097b5a;p=graphviz gvpr deparse: avoid accessing agxbuf internals This eases some upcoming changes to the internal structure of the `agxbuf` type. This alters the semantics of `deparse` (the buffer’s size ends up 0 on completion of this function), but this is acceptable as all callers go on to immediately free the buffer. Gitlab: #2302 --- diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index 4a143c46b..8b2a6727d 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -261,7 +261,7 @@ static Agdesc_t xargs(char *args) */ static char *deparse(Expr_t *ex, Exnode_t *n, agxbuf *xb) { exdump(ex, n, xb); - return xb->buf; + return agxbuse(xb); } /* deref: