Update the write_varint method to use an encoded buffer of size 9 instead of 10.

The SQLite varint specification states that the varint is guaranteed to be a maximum of 9 bytes, but our version of write_varint initializes a buffer of 10 bytes. Changing the size to match the specification.
This commit is contained in:
Sumit Patel
2025-10-25 16:53:59 +05:30
parent c2ac8ecc71
commit 7f8f1bc074
2 changed files with 2 additions and 2 deletions

View File

@@ -130,7 +130,7 @@ pub fn write_varint(buf: &mut [u8], value: u64) -> usize {
return 9;
}
let mut encoded: [u8; 10] = [0; 10];
let mut encoded: [u8; 9] = [0; 9];
let mut bytes = value;
let mut n = 0;
while bytes != 0 {