From 8c358e000ce50681517498523d23a36dc427b3a4 Mon Sep 17 00:00:00 2001 From: Matthieu Dorier Date: Wed, 28 Aug 2024 11:02:45 +0100 Subject: [PATCH] hot fix for bug in conversion from endpoint to string --- CMakeLists.txt | 2 +- include/thallium/endpoint.hpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8ec0ca..be0f7fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ endif () set (THALLIUM_VERSION_MAJOR 0) set (THALLIUM_VERSION_MINOR 14) -set (THALLIUM_VERSION_PATCH 2) +set (THALLIUM_VERSION_PATCH 3) set (thallium-vers "${THALLIUM_VERSION_MAJOR}.${THALLIUM_VERSION_MINOR}") set (THALLIUM_VERSION "${thallium-vers}.${THALLIUM_VERSION_PATCH}") math (EXPR THALLIUM_VERSION_NUM "${THALLIUM_VERSION_MAJOR}*1000000 + ${THALLIUM_VERSION_MINOR}*1000 + ${THALLIUM_VERSION_PATCH}") diff --git a/include/thallium/endpoint.hpp b/include/thallium/endpoint.hpp index 3e0ef8b..250b855 100644 --- a/include/thallium/endpoint.hpp +++ b/include/thallium/endpoint.hpp @@ -140,16 +140,16 @@ class endpoint { * @return A string representation of the endpoint's address. */ operator std::string() const { - std::string result; + std::vector result; if(m_addr == HG_ADDR_NULL) - return result; - hg_size_t size; + return std::string{}; + hg_size_t size; auto ret = margo_addr_to_string(m_mid, nullptr, &size, m_addr); MARGO_ASSERT(ret, margo_addr_to_string); result.resize(size); ret = margo_addr_to_string(m_mid, const_cast(result.data()), &size, m_addr); MARGO_ASSERT(ret, margo_addr_to_string); - return result; + return std::string{result.data()}; } /**