iconv() doesn't set the trailing zero
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1522,14 +1522,10 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
|
|||||||
|
|
||||||
wxString wxGetCwd()
|
wxString wxGetCwd()
|
||||||
{
|
{
|
||||||
wxString str;
|
wxChar *buffer = new wxChar[_MAXPATHLEN];
|
||||||
|
wxGetWorkingDirectory(buffer, _MAXPATHLEN);
|
||||||
// we can't create wxStringBuffer object inline: Sun CC generates buggy
|
wxString str( buffer );
|
||||||
// code in this case!
|
delete [] buffer;
|
||||||
{
|
|
||||||
wxStringBuffer buf(str, _MAXPATHLEN);
|
|
||||||
wxGetWorkingDirectory(buf, _MAXPATHLEN);
|
|
||||||
}
|
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
@@ -661,6 +661,9 @@ size_t IC_CharSet::MB2WC(wchar_t *buf, const char *psz, size_t n)
|
|||||||
// convert to native endianness
|
// convert to native endianness
|
||||||
WC_BSWAP(buf /* _not_ bufPtr */, res)
|
WC_BSWAP(buf /* _not_ bufPtr */, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// iconv doesn't seem to set the trailing 0
|
||||||
|
buf[res] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user