]> granicus.if.org Git - graphviz/commitdiff
graphml2gv: abbreviate an open coded 'strcat'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 8 May 2022 23:59:16 +0000 (16:59 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 19 May 2022 23:59:18 +0000 (16:59 -0700)
cmd/tools/graphml2gv.c

index 4b948e2e4053482d878af78a68ff537dbf957a09..5aafb020d58147a16f0d05e3253431732704d10c 100644 (file)
@@ -16,6 +16,7 @@
 #include    <cgraph/likely.h>
 #include    <cgraph/stack.h>
 #include    <getopt.h>
+#include    <string.h>
 #ifdef HAVE_EXPAT
 #include    <expat.h>
 #include    <ctype.h>
@@ -553,8 +554,7 @@ static void endElementHandler(void *userData, const char *name)
                name = dynbuf = N_NEW(len, char);
                strcpy(name, GRAPHML_COMP);
            }
-           strcpy(name + sizeof(GRAPHML_COMP) - 1,
-                  agxbuse(&ud->xml_attr_name));
+           strcat(name, agxbuse(&ud->xml_attr_name));
            value = agxbuse(&ud->composite_buffer);
            agxbclear(&ud->xml_attr_value);
            ud->compositeReadState = FALSE;