]> arthur.barton.de Git - bup.git/commitdiff
write_idx: make the 64-bit offset count uint32_t not int
authorRob Browning <rlb@defaultvalue.org>
Sun, 22 Nov 2020 18:27:27 +0000 (12:27 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 22 Nov 2020 21:09:48 +0000 (15:09 -0600)
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 <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/_helpers.c

index cf31d0aac2630eb44f35398dfa66e12f058875ad..f47de73a07d0e4a2734f88caa13bb0fc392f6280 100644 (file)
@@ -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);