Thomas Faber : gameux/tests: Avoid a variable-length array.

Alexandre Julliard julliard at winehq.org
Tue Mar 25 14:27:43 CDT 2014


Module: wine
Branch: master
Commit: 20dcd96de3622322e7ba3840e14e7666dccdbb02
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=20dcd96de3622322e7ba3840e14e7666dccdbb02

Author: Thomas Faber <thomas.faber at reactos.org>
Date:   Tue Mar 25 08:37:17 2014 +0100

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..f5dd2ab 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];
 
     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))
     {




More information about the wine-cvs mailing list