diff --git a/modules/core/test/tools/io/testNPZ.cpp b/modules/core/test/tools/io/testNPZ.cpp index 98f2b42bc8..ce7006cc06 100644 --- a/modules/core/test/tools/io/testNPZ.cpp +++ b/modules/core/test/tools/io/testNPZ.cpp @@ -72,6 +72,9 @@ TEST_CASE("Test visp::cnpy::npy_load/npz_save", "[visp::cnpy I/O]") { const std::string save_string = "Open Source Visual Servoing Platform"; std::vector vec_save_string(save_string.begin(), save_string.end()); + // Manually add a null-terminated character + // https://stackoverflow.com/a/8247804 + vec_save_string.push_back('\0'); const std::string identifier = "String"; visp::cnpy::npz_save(npz_filename, identifier, &vec_save_string[0], { vec_save_string.size() }, "w");