From c03184001ec5eeb9bf90a452119ccc033d17398b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 30 Apr 2019 13:06:41 +0200 Subject: [PATCH] dxgi: Avoid magic constants. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/dxgi/adapter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c index d96cb1e5b23..859c24a105e 100644 --- a/dlls/dxgi/adapter.c +++ b/dlls/dxgi/adapter.c @@ -149,8 +149,8 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac static HRESULT dxgi_adapter_get_desc(struct dxgi_adapter *adapter, DXGI_ADAPTER_DESC3 *desc) { + char description[ARRAY_SIZE(desc->Description)]; struct wined3d_adapter_identifier adapter_id; - char description[128]; HRESULT hr; adapter_id.driver_size = 0; @@ -161,7 +161,7 @@ static HRESULT dxgi_adapter_get_desc(struct dxgi_adapter *adapter, DXGI_ADAPTER_ if (FAILED(hr = wined3d_get_adapter_identifier(adapter->factory->wined3d, adapter->ordinal, 0, &adapter_id))) return hr; - if (!MultiByteToWideChar(CP_ACP, 0, description, -1, desc->Description, 128)) + if (!MultiByteToWideChar(CP_ACP, 0, description, -1, desc->Description, ARRAY_SIZE(description))) { DWORD err = GetLastError(); ERR("Failed to translate description %s (%#x).\n", debugstr_a(description), err);