From 5e075b920244f69fb9c271c4448bde8f8c596172 Mon Sep 17 00:00:00 2001 From: oddsock Date: Thu, 4 Dec 2003 16:27:30 +0000 Subject: [PATCH] Remove explicit exit() calls...this was possibly causing some cases of immediate UI termination without any messages... svn path=/trunk/avl/; revision=5683 --- src/avl/avl.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/avl/avl.c b/src/avl/avl.c index 2f20ded2..87be04c9 100644 --- a/src/avl/avl.c +++ b/src/avl/avl.c @@ -22,7 +22,7 @@ * */ -/* $Id: avl.c,v 1.9 2003/10/31 19:18:42 oddsock Exp $ */ +/* $Id: avl.c,v 1.10 2003/12/04 16:27:30 oddsock Exp $ */ /* * This is a fairly straightfoward translation of a prototype @@ -989,12 +989,10 @@ avl_verify_balance (avl_node * node) long lh = avl_verify_balance (node->left); long rh = avl_verify_balance (node->right); if ((rh - lh) != AVL_GET_BALANCE(node)) { - fprintf (stderr, "invalid balance at node %ld\n", (long) node->key); - exit(1); + return 0; } if (((lh - rh) > 1) || ((lh - rh) < -1)) { - fprintf (stderr, "unbalanced at node %ld\n", (long) node->key); - exit(1); + return 0; } return (1 + AVL_MAX (lh, rh)); } @@ -1004,8 +1002,7 @@ static void avl_verify_parent (avl_node * node, avl_node * parent) { if (node->parent != parent) { - fprintf (stderr, "invalid parent at node %ld\n", (long) node->key); - exit(1); + return; } if (node->left) { avl_verify_parent (node->left, node);