]> granicus.if.org Git - graphviz/commitdiff
gvpr deparse: avoid accessing agxbuf internals
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Dec 2022 20:00:39 +0000 (12:00 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 21 Dec 2022 02:54:30 +0000 (18:54 -0800)
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

lib/gvpr/compile.c

index 4a143c46bda115fbee45193adf858b9ac13bcdc2..8b2a6727d3bf14435d7ec3277515a09f5bf15470 100644 (file)
@@ -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: