From 69053566e39cb20205a870b3be5d136f64851588 Mon Sep 17 00:00:00 2001 From: Preetam Jinka Date: Tue, 25 Jul 2017 08:05:23 -0400 Subject: [PATCH] initialize LastCommit to 512 to prevent header truncation --- lm2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lm2.go b/lm2.go index 97b05e9..4bca1e6 100644 --- a/lm2.go +++ b/lm2.go @@ -218,7 +218,7 @@ func NewCollection(file string, cacheSize int) (*Collection, error) { // write file header c.fileHeader.Version = fileVersion c.fileHeader.Next[0] = 0 - c.fileHeader.LastCommit = int64(8 * 2) + c.fileHeader.LastCommit = int64(512) c.f.Seek(0, 0) err = binary.Write(c.f, binary.LittleEndian, c.fileHeader) if err != nil {