]> granicus.if.org Git - graphviz/commitdiff
gxl2gv endElementHandler: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 28 Aug 2022 15:59:58 +0000 (08:59 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 30 Aug 2022 04:01:31 +0000 (21:01 -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.

cmd/tools/gxl2gv.c

index 794b09390a5eae18e053c7050966a8c4209c3fbf..fb7a640096a126002a7bbe18588afa4a4ae88066 100644 (file)
@@ -20,7 +20,6 @@
 #include    <cgraph/exit.h>
 #include    <cgraph/likely.h>
 #include    <cgraph/stack.h>
-#include    <common/memory.h>
 #include    <stdio.h>
 #ifdef HAVE_EXPAT
 #include    <expat.h>
@@ -632,7 +631,7 @@ static void endElementHandler(void *userData, const char *name)
            if (len <= SMALLBUF) {
                new_name = buf;
            } else {
-               new_name = dynbuf = gcalloc(len, sizeof(char));
+               new_name = dynbuf = gv_calloc(len, sizeof(char));
                strcpy(new_name, GXL_COMP);
            }
            strcpy(new_name + sizeof(GXL_COMP) - 1,