mirror of
https://github.com/reactos/reactos.git
synced 2024-11-24 03:53:31 +08:00
[OLEAUT32] Use snprintf instead of sprintf
Fixes GCC 8 warning: dll/win32/oleaut32/oleaut.c:876:39: error: '%s' directive writing up to 99 bytes into a region of size between 92 and 291 [-Werror=format-overflow=] sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32); ^~ ~~~ dll/win32/oleaut32/oleaut.c:876:5: note: 'sprintf' output between 18 and 316 bytes into a destination of size 300 sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
8f050e66fd
commit
ddb56e8cca
@ -873,7 +873,11 @@ static HRESULT reg_get_typelib_module(REFIID iid, WCHAR *module, DWORD len)
|
||||
|
||||
RegCloseKey(ikey);
|
||||
|
||||
#ifndef __REACTOS__
|
||||
sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32);
|
||||
#else
|
||||
snprintf(typelibkey, sizeof(typelibkey), "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32);
|
||||
#endif // __REACTOS__
|
||||
tlfnlen = sizeof(tlfn);
|
||||
if (RegQueryValueA(HKEY_CLASSES_ROOT, typelibkey, tlfn, &tlfnlen))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user