From eaaa76ded31665d05be2cd950554569dc9d3ec00 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sun, 22 Nov 2020 12:27:27 -0600 Subject: [PATCH] write_idx: make the 64-bit offset count uint32_t not int It's a 31-bit offset into the 64-bit object offsets table. https://github.com/git/git/blob/master/Documentation/technical/pack-format.txt Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/_helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index cf31d0a..f47de73 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@ -1087,7 +1087,7 @@ static PyObject *write_idx(PyObject *self, PyObject *args) PyObject *part; unsigned int total = 0; uint32_t count; - int i, ofs64_count; + int i; uint32_t *fan_ptr, *crc_ptr, *ofs_ptr; uint64_t *ofs64_ptr; struct sha *sha_ptr; @@ -1119,7 +1119,7 @@ static PyObject *write_idx(PyObject *self, PyObject *args) ofs64_ptr = (uint64_t *)&ofs_ptr[total]; count = 0; - ofs64_count = 0; + uint32_t ofs64_count = 0; for (i = 0; i < FAN_ENTRIES; ++i) { part = PyList_GET_ITEM(idx, i); -- 2.39.2