]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/_helpers.c
midx4: Fix name offsets when generated from idx
[bup.git] / lib / bup / _helpers.c
index 938b7a3ad50ffbec02cc8193608779d62dde7854..0af94113bd87d0116576f165b93e533b702c067e 100644 (file)
@@ -330,7 +330,10 @@ static PyObject *merge_into(PyObject *self, PyObject *args)
            return NULL;
        idxs[i]->cur = (struct sha *)&idxs[i]->map[sha_ofs];
        idxs[i]->end = &idxs[i]->cur[len];
-       idxs[i]->cur_name = (uint32_t *)&idxs[i]->map[name_map_ofs];
+       if (name_map_ofs)
+           idxs[i]->cur_name = (uint32_t *)&idxs[i]->map[name_map_ofs];
+       else
+           idxs[i]->cur_name = NULL;
     }
     table_ptr = (uint32_t *)&fmap[12];
     sha_ptr = (struct sha *)&table_ptr[1<<bits];