diff --git a/Engine/source/main/main.cpp b/Engine/source/main/main.cpp index f4c4d95e6..56bed4ceb 100644 --- a/Engine/source/main/main.cpp +++ b/Engine/source/main/main.cpp @@ -75,10 +75,11 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdL return -1; } + enum { errorSize = 4096 }; if (!hGame) { - wchar_t error[4096]; - _swprintf_l(error, sizeof(error), L"Unable to load game library: %s. Please make sure it exists and the latest DirectX is installed.", _get_current_locale(), dllName.c_str()); + wchar_t error[errorSize]; + _swprintf_l(error, errorSize, L"Unable to load game library: %s. Please make sure it exists and the latest DirectX is installed.", _get_current_locale(), dllName.c_str()); MessageBoxW(NULL, error, L"Error", MB_OK|MB_ICONWARNING); return -1; } @@ -86,8 +87,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdL torque_winmain = (int (*)(HINSTANCE hInstance, HINSTANCE h, LPSTR lpszCmdLine, int nShow))GetProcAddress(hGame, "torque_winmain"); if (!torque_winmain) { - wchar_t error[4096]; - _swprintf_l(error, sizeof(error), L"Missing torque_winmain export in game library: %s. Please make sure that it exists and the latest DirectX is installed.", _get_current_locale(), dllName.c_str()); + wchar_t error[errorSize]; + _swprintf_l(error, errorSize, L"Missing torque_winmain export in game library: %s. Please make sure that it exists and the latest DirectX is installed.", _get_current_locale(), dllName.c_str()); MessageBoxW(NULL, error, L"Error", MB_OK|MB_ICONWARNING); return -1; }