]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
countnode234() should politely return 0 when passed NULL. Was
authorSimon Tatham <anakin@pobox.com>
Mon, 16 Apr 2001 21:24:38 +0000 (21:24 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 16 Apr 2001 21:24:38 +0000 (21:24 +0000)
breaking delpos234(empty_tree, 0).

[originally from svn r1054]

tree234.c

index 1f0267083cddda4ccfd895a2a244d1f43e97a17c..1aac3a6ba2f01af0119c170fa48735c7d6fc173b 100644 (file)
--- a/tree234.c
+++ b/tree234.c
@@ -90,6 +90,8 @@ void freetree234(tree234 *t) {
 static int countnode234(node234 *n) {
     int count = 0;
     int i;
+    if (!n)
+       return 0;
     for (i = 0; i < 4; i++)
        count += n->counts[i];
     for (i = 0; i < 3; i++)