OSDN Git Service

should start with mindepth
authorKoji Arai <jca02266@gmail.com>
Sat, 30 Aug 2008 13:43:16 +0000 (22:43 +0900)
committerKoji Arai <jca02266@gmail.com>
Sat, 30 Aug 2008 13:43:16 +0000 (22:43 +0900)
When table[] is assigned with a value which is smaller than mindepth,
it is not used in tree_rebuild().

src/pm2tree.c

index 6d66c37..c8d6a52 100644 (file)
@@ -117,7 +117,7 @@ tree_rebuild(struct tree *t,
             count[table[i]]++;
         }
         total = 0.0;
-        for (i = 1; i <= maxdepth; i++) {
+        for (i = mindepth; i <= maxdepth; i++) {
             int max_leaves = (1<<i);
             if (count[i] > max_leaves) {
                 error("Bad table");