As suggested, extract strlen calls from sizes into variables so it isn't called twice

This commit is contained in:
Glenn Smith 2018-03-08 20:59:40 -05:00
parent eab086e184
commit 47d5b6ead7
33 changed files with 171 additions and 114 deletions

View file

@ -182,8 +182,9 @@ extern "C" {
void torque_setexecutablepath(const char* directory)
{
gExecutablePath = new char[dStrlen(directory)+1];
dStrcpy(gExecutablePath, directory, dStrlen(directory)+1);
dsize_t pathLen = dStrlen(directory) + 1;
gExecutablePath = new char[pathLen];
dStrcpy(gExecutablePath, directory, pathLen);
}
// set Torque 3D into web deployment mode (disable fullscreen exlusive mode, etc)