Fixed String constructor (Close #24)

Former-commit-id: 4be4b713375ab4285776ec22b598117e3ede418a
This commit is contained in:
Lynix 2014-01-12 08:42:48 +01:00
parent b9dca8966d
commit bcfe357be7
1 changed files with 2 additions and 1 deletions

View File

@ -121,7 +121,8 @@ NzString::NzString(const char* string, unsigned int length)
m_sharedString->capacity = length;
m_sharedString->size = length;
m_sharedString->string = new char[length+1];
std::memcpy(m_sharedString->string, string, length+1);
std::memcpy(m_sharedString->string, string, length);
m_sharedString->string[length] = '\0';
}
else
m_sharedString = &emptyString;