From: Matthew Fernandez Date: Fri, 18 Mar 2022 15:21:23 +0000 (-0700) Subject: ccomps: abbreviate an open coded 'gv_strndup' X-Git-Tag: 4.0.0~166^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd2bf5c4dd612c4f50a011e92c31c5b50513353b;p=graphviz ccomps: abbreviate an open coded 'gv_strndup' --- diff --git a/cmd/tools/ccomps.c b/cmd/tools/ccomps.c index d3ad78fba..21d973d18 100644 --- a/cmd/tools/ccomps.c +++ b/cmd/tools/ccomps.c @@ -113,9 +113,7 @@ static void split(void) { if (sfx) { suffix = sfx + 1; size_t size = (size_t)(sfx - outfile); - path = gv_alloc(size + 1); - strncpy(path, outfile, size); - *(path + size) = '\0'; + path = gv_strndup(outfile, size); } else { path = outfile; }