# HG changeset patch # User jld # Date 1045864399 0 # Node ID ba66c013a6dc4764715318cdf31163056e1d94d0 # Parent 4ca0953b0734b746ecf30f1f96d902260d9d102c * common/eCosTestPlatform.cpp: Allow an extra char for string termination. diff --git a/host/tools/ecostest/ChangeLog b/host/tools/ecostest/ChangeLog --- a/host/tools/ecostest/ChangeLog +++ b/host/tools/ecostest/ChangeLog @@ -1,3 +1,9 @@ +2003-02-21 John Dallaway + + * common/eCosTestPlatform.cpp (CeCosTestPlatform::Load): Allow an + extra character for string termination when retrieving registry + key names. + 2003-02-13 John Dallaway * common/eCosTestPlatform.cpp: diff --git a/host/tools/ecostest/common/eCosTestPlatform.cpp b/host/tools/ecostest/common/eCosTestPlatform.cpp --- a/host/tools/ecostest/common/eCosTestPlatform.cpp +++ b/host/tools/ecostest/common/eCosTestPlatform.cpp @@ -171,14 +171,14 @@ bool CeCosTestPlatform::Load() DWORD dwMaxSubKeyLen; if(ERROR_SUCCESS==RegQueryInfoKey(hKey,NULL,NULL,NULL,&dwSubKeys,&dwMaxSubKeyLen,NULL,NULL,NULL,NULL,NULL,NULL)){ TCHAR *szName=new TCHAR[1+dwMaxSubKeyLen]; - DWORD dwSizeName=dwMaxSubKeyLen; + DWORD dwSizeName=sizeof(TCHAR)*(1+dwMaxSubKeyLen); for(DWORD dwIndex=0;ERROR_SUCCESS==RegEnumKeyEx(hKey, dwIndex, szName, &dwSizeName, NULL, NULL, NULL, &ftLastWriteTime); dwIndex++){ CeCosTestPlatform t; if(t.LoadFromRegistry(hKey,szName)){ t.m_strName=szName; CeCosTestPlatform::Add(t); } - dwSizeName=dwMaxSubKeyLen; + dwSizeName=sizeof(TCHAR)*(1+dwMaxSubKeyLen); } delete [] szName; }