]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix a small bug in 2-3-4 tree enumeration
authorSimon Tatham <anakin@pobox.com>
Tue, 26 Sep 2000 10:05:48 +0000 (10:05 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 26 Sep 2000 10:05:48 +0000 (10:05 +0000)
[originally from svn r630]

tree234.c

index 6a570f702fd6a2a2b641fdb2267152b8b6e3c551..955b6ef1100c57da981e7f637ec7a233f0121828 100644 (file)
--- a/tree234.c
+++ b/tree234.c
@@ -599,9 +599,9 @@ void *next234(enum234 *e) {
        return n->elems[0];
     }
 
-    if (pos == 0 && n->elems[1]) {
-       e->posn = 1;
-       return n->elems[1];
+    if (pos < 2 && n->elems[pos+1]) {
+       e->posn = pos+1;
+       return n->elems[e->posn];
     }
 
     do {