Added null pointer assertions to as_utf8 and as_wide

git-svn-id: http://pugixml.googlecode.com/svn/trunk@531 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2010-06-23 17:06:42 +00:00
parent 2da75b0f18
commit 34cbe32773

View File

@ -4459,6 +4459,8 @@ namespace pugi
#ifndef PUGIXML_NO_STL
std::string PUGIXML_FUNCTION as_utf8(const wchar_t* str)
{
assert(str);
STATIC_ASSERT(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4);
size_t length = wcslen(str);
@ -4495,6 +4497,8 @@ namespace pugi
std::wstring PUGIXML_FUNCTION as_wide(const char* str)
{
assert(str);
const uint8_t* data = reinterpret_cast<const uint8_t*>(str);
size_t size = strlen(str);