]> granicus.if.org Git - graphviz/commitdiff
Modify agdelete to indicate an error if the object does not
authorerg <devnull@localhost>
Sat, 19 Feb 2011 20:20:11 +0000 (20:20 +0000)
committererg <devnull@localhost>
Sat, 19 Feb 2011 20:20:11 +0000 (20:20 +0000)
belong to the graph

lib/cgraph/obj.c

index d83662997dec69428a30eb56fb400d85f377d187..ae0918b43137617d8d969ae085edb114a46a6b69 100755 (executable)
 
 int agdelete(Agraph_t * g, void *obj)
 {
-    if ((AGTYPE((Agobj_t *) obj) == AGRAPH) && (g != agparent(obj)))
+    if ((AGTYPE((Agobj_t *) obj) == AGRAPH) && (g != agparent(obj))) {
        agerr(AGERR, "agdelete on wrong graph");
+       return FAILURE;
+    }
 
     switch (AGTYPE((Agobj_t *) obj)) {
     case AGNODE: