From 81dfe23915fcdf9245dac96109a8ab048481b707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Thu, 26 Sep 2024 23:47:36 +0200 Subject: [PATCH] Fixes #192 ('"Missing/misused m_is_wide in char_wchar_holder assignment operators"). --- include/boost/interprocess/detail/char_wchar_holder.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/interprocess/detail/char_wchar_holder.hpp b/include/boost/interprocess/detail/char_wchar_holder.hpp index 8831aa20..0c078715 100644 --- a/include/boost/interprocess/detail/char_wchar_holder.hpp +++ b/include/boost/interprocess/detail/char_wchar_holder.hpp @@ -57,6 +57,7 @@ class char_wchar_holder this->delete_mem(); m_str.n = tmp; std::strcpy(m_str.n, nstr); + m_is_wide = false; return *this; } @@ -66,15 +67,16 @@ class char_wchar_holder this->delete_mem(); m_str.w = tmp; std::wcscpy(m_str.w, wstr); + m_is_wide = true; return *this; } char_wchar_holder& operator=(const char_wchar_holder &other) { if (other.m_is_wide) - *this = other.getn(); - else *this = other.getw(); + else + *this = other.getn(); return *this; }