gameux/tests: Avoid a variable-length array.

Thomas Faber thomas.faber at reactos.org
Tue Mar 25 05:54:14 CDT 2014


From b9f3f9bcc1c1e95128616e9caca9a6de926d566d Mon Sep 17 00:00:00 2001
From: Thomas Faber <thomas.faber at reactos.org>
Date: Tue, 25 Mar 2014 08:37:17 +0100
Subject: gameux/tests: Avoid a variable-length array.

---
 dlls/gameux/tests/gamestatistics.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c
index 7d57b1f..5be5fae 100644
--- a/dlls/gameux/tests/gamestatistics.c
+++ b/dlls/gameux/tests/gamestatistics.c
@@ -130,15 +130,13 @@ static HRESULT _buildStatisticsFilePath(LPCGUID guidApplicationId, LPWSTR *lpSta
             'l','o','r','e','r','\\','G','a','m','e','S','t','a','t','i','s',
             't','i','c','s','\\',0};
     static const WCHAR sDotGamestats[] = {'.','g','a','m','e','s','t','a','t','s',0};
-    static const DWORD dwGuidLength = 49;
-
     HRESULT hr;
-    WCHAR sGuid[dwGuidLength], sPath[MAX_PATH] = {0};
+    WCHAR sGuid[49], sPath[MAX_PATH] = {0};
 
     hr = pSHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, sPath);
 
     if(SUCCEEDED(hr))
-        hr = (StringFromGUID2(guidApplicationId, sGuid, dwGuidLength)!=0 ? S_OK : E_FAIL);
+        hr = (StringFromGUID2(guidApplicationId, sGuid, sizeof(sGuid) / sizeof(sGuid[0])) != 0 ? S_OK : E_FAIL);
 
     if(SUCCEEDED(hr))
     {
-- 
1.8.3.2



More information about the wine-patches mailing list