1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 14:59:54 +00:00

Fix null character issue in ESMReader::getString

This commit is contained in:
scrawl 2015-01-16 23:10:57 +01:00
parent 14aacf9a72
commit fc663addfa

View file

@ -299,8 +299,7 @@ std::string ESMReader::getString(int size)
char *ptr = &mBuffer[0]; char *ptr = &mBuffer[0];
getExact(ptr, size); getExact(ptr, size);
if (size>0 && ptr[size-1]==0) size = strnlen(ptr, size);
--size;
// Convert to UTF8 and return // Convert to UTF8 and return
if (mEncoder) if (mEncoder)