explicitly initialized m_mbs (std::mbstate_t) in utf8 transform iterators.

adjusted tests to be sure that wchar arrays/strings are null terminated.
This commit is contained in:
Robert Ramey
2015-11-24 10:48:03 -08:00
parent 9bb75492ff
commit 67b16f8a9d
3 changed files with 8 additions and 5 deletions

View File

@@ -116,6 +116,7 @@ public:
template<class T>
mb_from_wchar(T start) :
super_t(Base(static_cast< T >(start))),
m_mbs(std::mbstate_t()),
m_bend(0),
m_bnext(0),
m_full(false)

View File

@@ -124,8 +124,10 @@ public:
// make composible buy using templated constructor
template<class T>
wchar_from_mb(T start) :
super_t(Base(static_cast< T >(start)))
super_t(Base(static_cast< T >(start))),
m_mbs(std::mbstate_t())
{
BOOST_ASSERT(std::mbsinit(&m_mbs));
drain();
}
// copy ctor