]> granicus.if.org Git - graphviz/commitdiff
gv2gxl isGxlGrammar: use 'startswith' to abbreviate a 'strncmp'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 1 Oct 2022 02:19:34 +0000 (19:19 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 1 Oct 2022 02:19:34 +0000 (19:19 -0700)
cmd/tools/gv2gxl.c

index 979fed6d26904900b1ceefdaf1ad7d64489f1293..7f0b8f7d31e336f624c32e7e69439d15ab155ecd 100644 (file)
@@ -14,6 +14,7 @@
  *************************************************************************/
 
 #include <cgraph/alloc.h>
+#include <cgraph/startswith.h>
 #include <common/types.h>
 #include <common/utils.h>
 #include "convert.h"
@@ -173,7 +174,7 @@ static int xml_url_puts(FILE *f, const char *s) {
 
 static int isGxlGrammar(char *name)
 {
-    return (strncmp(name, GXL_ATTR, (sizeof(GXL_ATTR) - 1)) == 0);
+  return startswith(name, GXL_ATTR);
 }
 
 static int isLocatorType(char *name)