]> granicus.if.org Git - graphviz/commitdiff
Fix gvpack.c to make it compatible with cgraph
authorerg <devnull@localhost>
Tue, 29 Jun 2010 16:34:25 +0000 (16:34 +0000)
committererg <devnull@localhost>
Tue, 29 Jun 2010 16:34:25 +0000 (16:34 +0000)
cmd/tools/gvpack.c

index fae65a3d789ddfe9228a3eccf97f2ebc96c2c9f9..c9ccb02d77866b7c0c2266720c97bee30b42acdb 100644 (file)
@@ -276,6 +276,10 @@ static void init_node_edge(Agraph_t * g)
     }
 }
 
+#ifndef WITH_CGRAPH
+#define agnameof(g) ((g)->name)
+#endif
+
 /* init_graph:
  * Initialize attributes. We always do the minimum required by
  * libcommon. If fill is true, we use init_nop (neato -n) to
@@ -305,10 +309,10 @@ static void init_graph(Agraph_t * g, boolean fill, GVC_t* gvc)
        if (ret) {
            if (ret < 0)
                fprintf(stderr, "Error loading layout info from graph %s\n",
-                   g->name);
+                   agnameof(g));
            else if (ret > 0)
                fprintf(stderr, "gvpack does not support backgrounds as found in graph %s\n",
-                   g->name);
+                   agnameof(g));
            exit(1);
        }
     }