From: Florian Forster Date: Sun, 20 Feb 2011 13:42:53 +0000 (+0100) Subject: src/sn_network.c: sn_network_network_add(): Renumber stages. X-Git-Tag: v1.1.0~6 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=476b89798f738a92944b8824655d06ed8d2afa52;p=sort-networks.git src/sn_network.c: sn_network_network_add(): Renumber stages. --- diff --git a/src/sn_network.c b/src/sn_network.c index 7fee9b5..98b89fa 100644 --- a/src/sn_network.c +++ b/src/sn_network.c @@ -270,6 +270,7 @@ int sn_network_network_add (sn_network_t *n, sn_network_t *other) /* {{{ */ { int stages_num; sn_stage_t **tmp; + int i; if ((n == NULL) || (other == NULL)) return (EINVAL); @@ -285,6 +286,9 @@ int sn_network_network_add (sn_network_t *n, sn_network_t *other) /* {{{ */ memcpy (n->stages + n->stages_num, other->stages, sizeof (*other->stages) * other->stages_num); + for (i = n->stages_num; i < stages_num; i++) + SN_STAGE_DEPTH(n->stages[i]) = i; + n->stages_num = stages_num; free (other->stages);