aboutsummaryrefslogtreecommitdiff
path: root/dep/g3dlite/source/RegistryUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dep/g3dlite/source/RegistryUtil.cpp')
-rw-r--r--dep/g3dlite/source/RegistryUtil.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/dep/g3dlite/source/RegistryUtil.cpp b/dep/g3dlite/source/RegistryUtil.cpp
index 7c9e56f79ae..72c31212049 100644
--- a/dep/g3dlite/source/RegistryUtil.cpp
+++ b/dep/g3dlite/source/RegistryUtil.cpp
@@ -11,7 +11,7 @@
#include "G3D/platform.h"
// This file is only used on Windows
-#ifdef G3D_WIN32
+#ifdef G3D_WINDOWS
#include "G3D/RegistryUtil.h"
#include "G3D/System.h"
@@ -24,7 +24,6 @@
# define HKEY_PERFORMANCE_NLSTEXT ((HKEY)((LONG)0x80000060))
# endif
#endif
-
namespace G3D {
// static helpers
@@ -256,7 +255,8 @@ bool RegistryUtil::writeString(const std::string& key, const std::string& value,
debugAssert(result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND);
if (result == ERROR_SUCCESS) {
- result = RegSetValueExA(openKey, value.c_str(), 0, REG_SZ, reinterpret_cast<const BYTE*>(data.c_str()), (data.size() + 1));
+ alwaysAssertM(data.size() < 0xFFFFFFFE, "String too long");
+ result = RegSetValueExA(openKey, value.c_str(), 0, REG_SZ, reinterpret_cast<const BYTE*>(data.c_str()), (int)(data.size() + 1));
debugAssertM(result == ERROR_SUCCESS, "Could not write registry key value.");
RegCloseKey(openKey);
@@ -296,4 +296,4 @@ static HKEY getRootKeyFromString(const char* str, size_t length) {
} // namespace G3D
-#endif // G3D_WIN32
+#endif // G3D_WINDOWS