diff --git a/tesseract_common/include/tesseract_common/serialization.h b/tesseract_common/include/tesseract_common/serialization.h index f86a22f07f8..5c1becbcad4 100644 --- a/tesseract_common/include/tesseract_common/serialization.h +++ b/tesseract_common/include/tesseract_common/serialization.h @@ -113,7 +113,7 @@ struct Serialization { fs::path fp(file_path); if (!fp.has_extension()) - fp.append(".").append(serialization::xml::extension::value); + fp = fs::path(file_path + "." + serialization::xml::extension::value); std::ofstream os(fp.string()); { // Must be scoped because all data is not written until the oost::archive::xml_oarchive goes out of scope @@ -138,7 +138,7 @@ struct Serialization { fs::path fp(file_path); if (!fp.has_extension()) - fp.append(".").append(serialization::binary::extension::value); + fp = fs::path(file_path + "." + serialization::binary::extension::value); std::ofstream os(fp.string(), std::ios_base::binary); { // Must be scoped because all data is not written until the oost::archive::xml_oarchive goes out of scope