Skip to content

Commit 0a32923

Browse files
committed
fix footer read offset
1 parent 28460b1 commit 0a32923

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libsql-wal/src/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ where
377377
let len = db_file.len()?;
378378
if len as usize % LIBSQL_PAGE_SIZE as usize == size_of::<LibsqlFooter>() {
379379
let mut footer: LibsqlFooter = LibsqlFooter::new_zeroed();
380-
let footer_offset = LIBSQL_PAGE_SIZE as u64 * len;
380+
let footer_offset = (len / LIBSQL_PAGE_SIZE as u64) * LIBSQL_PAGE_SIZE as u64;
381381
db_file.read_exact_at(footer.as_bytes_mut(), footer_offset)?;
382382
footer.validate()?;
383383
Ok(Some(footer))

0 commit comments

Comments
 (0)