baum

diff actions.c @ 53:036779d5da75

"sum" node clears its value now everytime it gets called
author meillo@marmaro.de
date Sun, 02 Mar 2008 16:32:52 +0100
parents 201b4603671a
children 6279e5b14d9e
line diff
     1.1 --- a/actions.c	Sun Mar 02 16:26:06 2008 +0100
     1.2 +++ b/actions.c	Sun Mar 02 16:32:52 2008 +0100
     1.3 @@ -64,6 +64,8 @@
     1.4  
     1.5  unsigned char action_sum(struct Node* node) {
     1.6  	struct Node* tp;
     1.7 +
     1.8 +	node->value = 0;
     1.9  	tp = node->down;
    1.10  	while (tp != NULL) {
    1.11  		node->value += action(tp);
    1.12 @@ -93,7 +95,6 @@
    1.13  		/* return value */
    1.14  		input = action(node->down);
    1.15  	}
    1.16 -
    1.17  	insertLast(node, newNode("number", (char) input));
    1.18  	return 0;
    1.19  }