mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 22:53:53 +00:00
Merge branch 'off_by_one_windows_crashcatcher' into 'master'
Fix an off-by-one in windows_crashcatcher.cpp See merge request OpenMW/openmw!801
This commit is contained in:
commit
471ab431f5
1 changed files with 1 additions and 1 deletions
|
@ -136,7 +136,7 @@ namespace Crash
|
||||||
|
|
||||||
memset(mShm->mStartup.mLogFilePath, 0, sizeof(mShm->mStartup.mLogFilePath));
|
memset(mShm->mStartup.mLogFilePath, 0, sizeof(mShm->mStartup.mLogFilePath));
|
||||||
int length = crashLogPath.length();
|
int length = crashLogPath.length();
|
||||||
if (length > MAX_LONG_PATH) length = MAX_LONG_PATH;
|
if (length >= MAX_LONG_PATH) length = MAX_LONG_PATH - 1;
|
||||||
strncpy(mShm->mStartup.mLogFilePath, crashLogPath.c_str(), length);
|
strncpy(mShm->mStartup.mLogFilePath, crashLogPath.c_str(), length);
|
||||||
mShm->mStartup.mLogFilePath[length] = '\0';
|
mShm->mStartup.mLogFilePath[length] = '\0';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue