Skip to content

Commit 81dfe23

Browse files
committed
Fixes #192 ('"Missing/misused m_is_wide in char_wchar_holder assignment operators").
1 parent a22d498 commit 81dfe23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/boost/interprocess/detail/char_wchar_holder.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class char_wchar_holder
5757
this->delete_mem();
5858
m_str.n = tmp;
5959
std::strcpy(m_str.n, nstr);
60+
m_is_wide = false;
6061
return *this;
6162
}
6263

@@ -66,15 +67,16 @@ class char_wchar_holder
6667
this->delete_mem();
6768
m_str.w = tmp;
6869
std::wcscpy(m_str.w, wstr);
70+
m_is_wide = true;
6971
return *this;
7072
}
7173

7274
char_wchar_holder& operator=(const char_wchar_holder &other)
7375
{
7476
if (other.m_is_wide)
75-
*this = other.getn();
76-
else
7777
*this = other.getw();
78+
else
79+
*this = other.getn();
7880
return *this;
7981
}
8082

0 commit comments

Comments
 (0)