fixup! merge master and mv FindDevIL to cmake-modules

pull/1212/head
aoowweenn 2017-03-05 23:36:36 +08:00
parent 83db3fc084
commit c0c480a4cb
1 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ namespace pmx
std::string result;
const char* sourceStart = buffer.data();
const unsigned int targetSize = size * 3;
const unsigned int targetSize = size * 3; // enough to encode
char* targetStart = new char[targetSize]();
const char* targetReserved = targetStart;
ConversionFlags flags = ConversionFlags::lenientConversion;
@ -70,7 +70,7 @@ namespace pmx
throw DeadlyImportError( "Convert " + std::string(sourceStart) + " to UTF8 is not valid." );
}
result.assign(targetReserved, targetSize);
result.assign(targetReserved, targetStart - targetReserved);
delete[] targetReserved;
return result;
}