]> granicus.if.org Git - graphviz/commitdiff
gvmap: remove dynamic allocation for line color
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 14 Aug 2021 21:23:13 +0000 (14:23 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 23 Aug 2021 14:57:19 +0000 (07:57 -0700)
Following the prior type signature changes, there is no need to dynamically
allocate this.

cmd/gvmap/gvmap.c

index aafa9f41973d79f3de9784f59e25b6a4a4520458..d26df0f42a125ff7aa24ef1c8f72048de9bd2834 100644 (file)
@@ -53,7 +53,7 @@ typedef struct {
     bool color_optimize;
     int maxcluster;
     int nedgep;
-    char *line_color;
+    const char *line_color;
     int include_OK_points;
     int highlight_cluster;
     int seed;      /* seed used to calculate Fiedler vector */
@@ -175,7 +175,7 @@ init(int argc, char **argv, params_t* pm)
 
   pm->cmd = cmd;
   pm->infiles = NULL;
-  pm->line_color = strdup("#000000");
+  pm->line_color = "#000000";
   pm->include_OK_points = FALSE;
   pm->seed = 123;
 
@@ -290,8 +290,7 @@ init(int argc, char **argv, params_t* pm)
       break;
     }
     case 'z': {
-      FREE (pm->line_color);
-      pm->line_color = strdup (optarg);
+      pm->line_color = optarg;
       break;
     }
     case 'b':