aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kaiser <gkaiser@google.com>2018-04-06 16:35:02 -0700
committerGreg Kaiser <gkaiser@google.com>2018-12-28 10:20:40 -0800
commit06f8beac29b074264b8ed112ae71c113489f1758 (patch)
tree9164d2ae70d3bdf7bb7e0a078716ac76c33bac8c
parent1fc951b21c7c69764512ac32cd5b63a0c828b3e1 (diff)
downloadsdk-06f8beac29b074264b8ed112ae71c113489f1758.tar.gz
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
-rwxr-xr-xfind_java2/src/utils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/find_java2/src/utils.cpp b/find_java2/src/utils.cpp
index 7f4aa02bc..7c8c66b67 100755
--- a/find_java2/src/utils.cpp
+++ b/find_java2/src/utils.cpp
@@ -219,7 +219,7 @@ int execWait(const TCHAR *cmd) {
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();