From: erg Date: Sat, 19 Feb 2011 20:20:11 +0000 (+0000) Subject: Modify agdelete to indicate an error if the object does not X-Git-Tag: LAST_LIBGRAPH~32^2~1018 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34d4e2cb72302ffb365ce157d15c4393684a3129;p=graphviz Modify agdelete to indicate an error if the object does not belong to the graph --- diff --git a/lib/cgraph/obj.c b/lib/cgraph/obj.c index d83662997..ae0918b43 100755 --- a/lib/cgraph/obj.c +++ b/lib/cgraph/obj.c @@ -15,8 +15,10 @@ 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: