aboutsummaryrefslogtreecommitdiff
path: root/dep/g3dlite/source/RegistryUtil.cpp
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-08-23 16:41:54 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-08-23 16:41:54 +0200
commit4a29c73403c4dc713a8a31cb96289adff2b910c1 (patch)
treede0c6b191031bac7fb2764edb2a81382a331f81c /dep/g3dlite/source/RegistryUtil.cpp
parentb90329d63acaecb1f074dd2b303561baa9f639a2 (diff)
parent1255434882777053bca06656786abc1a598deda9 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
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