Yikes! Replace a + with a *. No wonder the file was small enough
[sgt/agedu] / index.c
diff --git a/index.c b/index.c
index c42da39..28119c8 100644 (file)
--- a/index.c
+++ b/index.c
@@ -52,7 +52,7 @@ static int index_maxdepth(int nodecount)
 off_t index_initial_size(off_t currentsize, int nodecount)
 {
     currentsize += PADDING(currentsize, alignof(off_t));
-    currentsize += nodecount + sizeof(off_t);
+    currentsize += nodecount * sizeof(off_t);
     currentsize += PADDING(currentsize, alignof(struct avlnode));
 
     return currentsize;