fixed typo, and added file pointer checks.

This commit is contained in:
2026-02-02 19:14:14 +01:00
parent 76dbd757e3
commit 30fbd8eb67
2 changed files with 12 additions and 102 deletions

View File

@@ -389,14 +389,14 @@ int dump_header_nexus(const std::string fileName, const bool counts) {
#ifdef HAVE_HDF4
std::unique_ptr<nxH4::PNeXus> nxs_file = std::make_unique<nxH4::PNeXus>(fileName);
if (nxs_file == nullptr) {
std::cerr << std::endl << "**ERROR** allocation of nxH4::PNeXus object faild." << std::endl;
std::cerr << std::endl << "**ERROR** allocation of nxH4::PNeXus object failed." << std::endl;
}
nxs_file->Dump();
#endif
} else { // HDF5
std::unique_ptr<nxH5::PNeXus> nxs_file = std::make_unique<nxH5::PNeXus>(fileName);
if (nxs_file == nullptr) {
std::cerr << std::endl << "**ERROR** allocation of nxH5::PNeXus object faild." << std::endl;
std::cerr << std::endl << "**ERROR** allocation of nxH5::PNeXus object failed." << std::endl;
}
nxs_file->Dump();
}