Fix a few more where we need to specify number of TCHARs rather than sizeof buffer

This commit is contained in:
Doug MacEachern committed 2007-11-15 21:48:24 +00:00
1 parent 2fd3beab06
commit f448bae54e
4 files changed
+7 -6

No files matched your search

+2 -2
View File
@@ -431,8 +431,8 @@ JNIEXPORT jobjectArray SIGAR_JNI(win32_Pdh_pdhGetObjects)
JNIEXPORT jstring SIGAR_JNI(win32_Pdh_pdhLookupPerfName)
(JNIEnv *env, jclass cur, jint index)
{
TCHAR path[MAX_PATH];
DWORD len = MAX_PATH; /* len is number of TCHAR's, not sizeof(path) */
TCHAR path[MAX_PATH + 1];
DWORD len = sizeof(path) / sizeof(TCHAR); /* len is number of TCHAR's, not sizeof(path) */
PDH_STATUS status =
PdhLookupPerfNameByIndex(NULL, index, path, &len);