diff --git a/include/h5pp/details/h5ppHdf5.h b/include/h5pp/details/h5ppHdf5.h index 10b3d65b..bda4a4c4 100644 --- a/include/h5pp/details/h5ppHdf5.h +++ b/include/h5pp/details/h5ppHdf5.h @@ -2941,13 +2941,14 @@ namespace h5pp::hdf5 { } template - inline void writeTableRecords(const DataType &data, TableInfo &info, size_t offset = 0, std::optional extent = std::nullopt) { + inline void writeTableRecords(const DataType &data, TableInfo &info, hsize_t offset = 0, std::optional extent = std::nullopt) { /* * This function replaces H5TBwrite_records() and avoids creating expensive temporaries for the dataset id and type id for the * compound table type. In addition, it has the ability to extend the existing the dataset if the incoming data larger than the * current bound */ info.assertWriteReady(); + offset = util::wrapUnsigned(offset, info.numRecords.value()); // Allows python style negative indexing if constexpr(std::is_same_v>) { if(not extent) extent = data.size() / info.recordBytes.value();