Skip to content

Commit

Permalink
Read whole name of object identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAce committed Feb 25, 2021
1 parent f7ae736 commit b210e82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h5pp/include/h5pp/details/h5ppHdf5.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace h5pp::hdf5 {
ssize_t bufSize = H5Iget_name(object, nullptr, 0); // Size in bytes of the object name (NOT including \0)
if(bufSize > 0) {
buf.resize(static_cast<size_t>(bufSize) + 1); // We allocate space for the null terminator
H5Iget_name(object, buf.data(), static_cast<size_t>(bufSize));
H5Iget_name(object, buf.data(), static_cast<size_t>(bufSize+1));
}
return buf.c_str(); // Use .c_str() to get a "standard" std::string, i.e. one where .size() does not include \0
}
Expand Down

0 comments on commit b210e82

Please sign in to comment.