]> granicus.if.org Git - graphviz/commitdiff
dotgen swap_spline: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 14 Sep 2022 01:34:56 +0000 (18:34 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 14 Sep 2022 01:39:23 +0000 (18:39 -0700)
The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.

lib/dotgen/dotsplines.c

index d5e7ade1fb55c81b071e81368a936260bf9f9354..d42b24b2f2643dcef2182cc111131716ba570554 100644 (file)
@@ -222,7 +222,7 @@ static void swap_spline(splines * s)
     int i, sz;
 
     sz = s->size;
-    list = N_GNEW(sz, bezier);
+    list = gv_calloc(sz, sizeof(bezier));
     lp = list;
     olp = s->list + (sz - 1);
     for (i = 0; i < sz; i++) { /* reverse and swap list of beziers */