From: Matthew Fernandez Date: Sat, 1 Oct 2022 02:17:26 +0000 (-0700) Subject: gc cntCluster: use 'startswith' to abbreviate a 'strncmp' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96dc1f236c96369e93b3cbd8078a81275611f7bc;p=graphviz gc cntCluster: use 'startswith' to abbreviate a 'strncmp' --- diff --git a/cmd/tools/gc.c b/cmd/tools/gc.c index c3899aa1b..93ad8a566 100644 --- a/cmd/tools/gc.c +++ b/cmd/tools/gc.c @@ -26,6 +26,7 @@ #include #include #include +#include typedef struct { Agrec_t h; @@ -187,7 +188,7 @@ static void cntCluster(Agraph_t * g, Agobj_t * sg, void *arg) char *sgname = agnameof(sg); - if (strncmp(sgname, "cluster", 7) == 0) + if (startswith(sgname, "cluster")) *(int *) (arg) += 1; }