Extra diagnostics in the hope that we can track down the problem with
[u/mdw/putty] / tree234.c
index 1f02670..017a12a 100644 (file)
--- a/tree234.c
+++ b/tree234.c
@@ -39,7 +39,8 @@
 #ifdef TEST
 #define LOG(x) (printf x)
 #else
-#define LOG(x)
+// FIXME
+#define LOG(x) (dprintf x)
 #endif
 
 typedef struct node234_Tag node234;
@@ -90,6 +91,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++)
@@ -570,7 +573,6 @@ static void *delpos234_internal(tree234 *t, int index) {
     LOG(("deleting item %d from tree %p\n", index, t));
     while (1) {
        while (n) {
-           int c;
            int ki;
            node234 *sub;