fix paste issue that null character is copied on Linux

This commit is contained in:
Jinhao 2015-11-16 00:57:50 +08:00
parent 1e6360843e
commit d3865fab63

View File

@ -115,10 +115,10 @@ namespace nana{ namespace system{
#else
str.reserve(size / sizeof(nana::char_t));
str.append(reinterpret_cast<nana::char_t*>(res), reinterpret_cast<nana::char_t*>(res) + size / sizeof(nana::char_t));
nana::string::size_type pos = str.find_last_not_of(nana::char_t(0));
#endif
auto pos = str.find_last_not_of(nana::char_t(0));
if(pos != str.npos)
str.erase(pos + 1);
#endif
#if defined(NANA_X11)
::XFree(res);