]> granicus.if.org Git - graphviz/commitdiff
graphml2gv: remove 'xml_attr_name' from 'userdata_t'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 13 Oct 2022 04:31:29 +0000 (21:31 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 14 Oct 2022 15:36:14 +0000 (08:36 -0700)
1d28d7d2b4d2b2551bd1f432aa175f54a69364a4 seems to have copied this
implementation of `userdata_t` from cmd/tools/gxl2gv.c without noticing the
`xml_attr_name` member is never written to in graphml2gv.

cmd/tools/graphml2gv.c

index fe212decd46bc52a3c5a82e176779a917b055fcf..52e01aaa2e4294282259fcc9c5c3a042afb8db2a 100644 (file)
@@ -86,7 +86,6 @@ static void freeString(gv_stack_t *stk) {
 }
 
 typedef struct {
-    agxbuf xml_attr_name;
     agxbuf xml_attr_value;
     agxbuf composite_buffer;
     char* gname;
@@ -146,7 +145,6 @@ static userdata_t *genUserdata(char* dfltname)
 static void freeUserdata(userdata_t * ud)
 {
     dtclose(ud->nameMap);
-    agxbfree(&(ud->xml_attr_name));
     agxbfree(&(ud->xml_attr_value));
     agxbfree(&(ud->composite_buffer));
     freeString(&ud->elements);
@@ -484,11 +482,10 @@ static void endElementHandler(void *userData, const char *name)
        ud->closedElementType = TAG_EDGE;
        ud->edgeinverted = FALSE;
     } else if (strcmp(name, "attr") == 0) {
-       char *name;
+       char *name = "";
        char *value;
 
        ud->closedElementType = TAG_NONE;
-       name = agxbuse(&ud->xml_attr_name);
        value = agxbuse(&ud->xml_attr_value);
 
        setAttr(name, value, ud);