]> granicus.if.org Git - graphviz/commitdiff
rephrase an open-coded strdup
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 20 May 2021 00:30:38 +0000 (17:30 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 28 May 2021 14:49:25 +0000 (07:49 -0700)
It is unclear why this was written this way or why it allocated more bytes than
necessary.

cmd/gvmap/gvmap.c

index 6fed6517a36e87967e92f50310b52d35b0dc00a3..73032c712117b37c84a46dc4df85018ebdf048c7 100644 (file)
@@ -180,8 +180,7 @@ init(int argc, char **argv, params_t* pm)
 
   pm->cmd = cmd;
   pm->infiles = NULL;
-  pm->line_color = N_NEW(10,char);
-  strcpy(pm->line_color,"#000000");
+  pm->line_color = strdup("#000000");
   pm->include_OK_points = FALSE;
   pm->seed = 123;