find_java2: Fix array size calculation
GetModuleFileName() takes the maximum number of TCHARs we can
fit as the final argument, and thus we need to divide by
sizeof(TCHAR), instead of multiplying by it.
Test: Treehugger
Change-Id: Icbbb04c29955075e9341a0153dbd750cce8e884b
diff --git a/find_java2/src/utils.cpp b/find_java2/src/utils.cpp
index 7f4aa02..7c8c66b 100755
--- a/find_java2/src/utils.cpp
+++ b/find_java2/src/utils.cpp
@@ -219,7 +219,7 @@
bool getModuleDir(CPath *outDir) {
TCHAR programDir[MAX_PATH];
- int ret = GetModuleFileName(NULL, programDir, sizeof(programDir) * sizeof(TCHAR));
+ int ret = GetModuleFileName(NULL, programDir, sizeof(programDir) / sizeof(programDir[0]));
if (ret != 0) {
CPath dir(programDir);
dir.RemoveFileSpec();