KWSys: Avoid passing string literal as char*
Pass the lpClass argument of RegCreateKeyEx as a real char[] instead of a string literal. At least one platform declares the argument as char* instead of "const char*".
This commit is contained in:
parent
428e0e0ab9
commit
75191fa312
@ -401,8 +401,9 @@ bool RegistryHelper::Open(const char *toplevel, const char *subkey,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
char lpClass[] = "";
|
||||||
res = ( RegCreateKeyEx(scope, str.str().c_str(),
|
res = ( RegCreateKeyEx(scope, str.str().c_str(),
|
||||||
0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
|
0, lpClass, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
|
||||||
NULL, &this->HKey, &dwDummy) == ERROR_SUCCESS );
|
NULL, &this->HKey, &dwDummy) == ERROR_SUCCESS );
|
||||||
}
|
}
|
||||||
if ( res != 0 )
|
if ( res != 0 )
|
||||||
|
@ -734,10 +734,11 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value,
|
|||||||
|
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
DWORD dwDummy;
|
DWORD dwDummy;
|
||||||
|
char lpClass[] = "";
|
||||||
if(RegCreateKeyEx(primaryKey,
|
if(RegCreateKeyEx(primaryKey,
|
||||||
second.c_str(),
|
second.c_str(),
|
||||||
0,
|
0,
|
||||||
"",
|
lpClass,
|
||||||
REG_OPTION_NON_VOLATILE,
|
REG_OPTION_NON_VOLATILE,
|
||||||
SystemToolsMakeRegistryMode(KEY_WRITE, view),
|
SystemToolsMakeRegistryMode(KEY_WRITE, view),
|
||||||
NULL,
|
NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user