Use a constant for the buffer size.

This commit is contained in:
robotbrain 2014-03-05 16:35:35 -05:00
parent bb6894893d
commit 6e964acde5

View File

@ -38,7 +38,8 @@
#include <logger/QsLogDest.h>
#ifdef Q_OS_WIN32
#include "windows.h"
#include <windows.h>
static const int APPDATA_BUFFER_SIZE = 1024;
#endif
using namespace Util::Commandline;
@ -322,9 +323,9 @@ void MultiMC::initGlobalSettings()
#ifdef Q_OS_LINUX
QString ftbDefault = QDir::home().absoluteFilePath(".ftblauncher");
#elif defined(Q_OS_WIN32)
wchar_t buf[1000];
wchar_t buf[APPDATA_BUFFER_SIZE];
QString ftbDefault;
if(!GetEnvironmentVariableW(L"APPDATA", buf, 1000))
if(!GetEnvironmentVariableW(L"APPDATA", buf, APPDATA_BUFFER_SIZE))
{
QLOG_FATAL() << "Your APPDATA folder is missing! If you are on windows, this means your system is broken. If you aren't on windows, how the **** are you running the windows build????";
}