baum

diff actions.c @ 38:ff01f0f076e4

option_verbose is now global; stuff about warning when (expected) nodes are not there
author meillo@marmaro.de
date Sat, 01 Mar 2008 20:04:08 +0100
parents b11ac43f3917
children 1ad3d7305e5d
line diff
     1.1 --- a/actions.c	Sat Mar 01 17:55:42 2008 +0100
     1.2 +++ b/actions.c	Sat Mar 01 20:04:08 2008 +0100
     1.3 @@ -14,7 +14,9 @@
     1.4  
     1.5  unsigned char action(struct Node* node) {
     1.6  	if (node == NULL) {
     1.7 -		fprintf(stderr, "action of non existing node\n");
     1.8 +		if (option_verbose) {
     1.9 +			fprintf(stderr, "warning: action of non existing node\n");
    1.10 +		}
    1.11  		return 0;
    1.12  	}
    1.13  
    1.14 @@ -67,7 +69,9 @@
    1.15  
    1.16  
    1.17  unsigned char action_number(struct Node* node) {
    1.18 -	action(node->down);
    1.19 +	if (node->down != NULL) {
    1.20 +		action(node->down);
    1.21 +	}
    1.22  	return node->value;
    1.23  }
    1.24