Skip to content

Commit

Permalink
Fixes #192 ('"Missing/misused m_is_wide in char_wchar_holder assignme…
Browse files Browse the repository at this point in the history
…nt operators").
  • Loading branch information
igaztanaga committed Sep 26, 2024
1 parent a22d498 commit 81dfe23
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/boost/interprocess/detail/char_wchar_holder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 81dfe23

Please sign in to comment.