Fix reg type & missing snprintf
This commit is contained in:
parent
bc95707618
commit
1c7111c10d
|
@ -1458,7 +1458,7 @@ void CxbxInitFilePaths()
|
|||
{
|
||||
LONG result = ERROR_SUCCESS;
|
||||
|
||||
dwType = REG_DWORD; dwSize = sizeof(szAppData);
|
||||
dwType = REG_SZ; dwSize = sizeof(szAppData);
|
||||
result = RegQueryValueEx(hKey, "DATALOC", NULL, &dwType, (PBYTE)&szAppData, &dwSize);
|
||||
if (result != ERROR_SUCCESS) {
|
||||
SHGetSpecialFolderPath(NULL, szAppData, CSIDL_APPDATA, TRUE); //Luke wants default to be %appdata%
|
||||
|
@ -1466,6 +1466,8 @@ void CxbxInitFilePaths()
|
|||
|
||||
}
|
||||
|
||||
snprintf(szFolder_CxbxReloadedData, MAX_PATH, "%s\\Cxbx-Reloaded", szAppData);
|
||||
|
||||
// Make sure our data folder exists :
|
||||
int result = SHCreateDirectoryEx(nullptr, szFolder_CxbxReloadedData, nullptr);
|
||||
if ((result != ERROR_SUCCESS) && (result != ERROR_ALREADY_EXISTS)) {
|
||||
|
|
Loading…
Reference in New Issue