]> granicus.if.org Git - graphviz/commitdiff
graphml2gv: remove 'xml_attr_value' from 'userdata_t'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 13 Oct 2022 04:33:36 +0000 (21:33 -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_value` member is never written to in graphml2gv.

cmd/tools/graphml2gv.c

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