Skip to content

Commit

Permalink
initialize LastCommit to 512 to prevent header truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
Preetam committed Jul 25, 2017
1 parent 6244b03 commit 6905356
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lm2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6905356

Please sign in to comment.