baum

diff actions.c @ 46:22305a6e128d

added deep copy and fixed so node times
author meillo@marmaro.de
date Sun, 02 Mar 2008 10:29:55 +0100
parents 0b82169d4129
children c31b5bb6d493
line diff
     1.1 --- a/actions.c	Sat Mar 01 21:49:41 2008 +0100
     1.2 +++ b/actions.c	Sun Mar 02 10:29:55 2008 +0100
     1.3 @@ -87,17 +87,9 @@
     1.4  
     1.5  
     1.6  unsigned char action_times(struct Node* node) {
     1.7 -	struct Node* tp;
     1.8 -	struct Node* last;
     1.9  	unsigned char i;
    1.10 -	tp = node->down;
    1.11  	for (i = 0; i < node->value; i++) {
    1.12 -		/* FIXME deep copy */
    1.13 -		last = insertLast(node, newNode(tp->name, tp->value));
    1.14 -		if (tp->down != NULL) {
    1.15 -			last->down = newNode(tp->down->name, tp->down->value);
    1.16 -		}
    1.17 -
    1.18 +		insertLast(node, copyTree(node->down));
    1.19  	}
    1.20  	return 0;
    1.21  }