2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 04:45:15 +00:00

Fix missing byte

This commit is contained in:
Alexander Neumann 2014-09-18 22:34:08 +02:00
parent 1c03bd7f7b
commit 878a96e761
2 changed files with 6 additions and 1 deletions

View File

@ -186,7 +186,7 @@ func (c *chunker) Next() (*Chunk, error) {
c.digest ^= mod_table[index]
if (c.count+i+1 >= MinSize && (c.digest&splitmask) == 0) || c.count+i+1 >= MaxSize {
c.data = append(c.data, c.buf[c.bpos:c.bpos+i]...)
c.data = append(c.data, c.buf[c.bpos:c.bpos+i+1]...)
c.count += i + 1
c.pos += i + 1
c.bpos += i + 1

View File

@ -64,6 +64,11 @@ func test_with_data(t *testing.T, chunker chunker.Chunker, chunks []chunk) {
i, chunk.Length, c.Length)
}
if len(c.Data) != chunk.Length {
t.Fatalf("Data length for chunk %d does not match: expected %d, got %d",
i, chunk.Length, len(c.Data))
}
if c.Cut != chunk.CutFP {
t.Fatalf("Cut fingerprint for chunk %d does not match: expected %016x, got %016x",
i, chunk.CutFP, c.Cut)