summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-01-14 08:51:52 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2019-01-14 10:01:18 +0000
commit46c824638dcaf240eb9d6163a4b9512cc2667719 (patch)
tree6f847a7176fb1fbb3cc6ae57ddec18424e78c0fa
parent95e49e77438077353254622d4c61f3cb3d5c5f49 (diff)
Fix off by one comparison.
We need at least two arguments (executable + the gtest output argument) to match the gtest xml framework. Test: dex_file_ext_c_test Change-Id: I030a1647421e0de44e3ab4bd9fb93cc5ec1ab83c
-rw-r--r--libdexfile/external/dex_file_ext_c_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdexfile/external/dex_file_ext_c_test.c b/libdexfile/external/dex_file_ext_c_test.c
index 85cd46e442..c448a169ec 100644
--- a/libdexfile/external/dex_file_ext_c_test.c
+++ b/libdexfile/external/dex_file_ext_c_test.c
@@ -47,7 +47,7 @@ static int write_gtest_output_xml(char* gtest_output_path) {
}
int main(int argc, char** argv) {
- if (argc >= 1 && strncmp(argv[1], gtest_output_arg, sizeof(gtest_output_arg) - 1) == 0) {
+ if (argc >= 2 && strncmp(argv[1], gtest_output_arg, sizeof(gtest_output_arg) - 1) == 0) {
/* The ART gtest framework expects all tests to understand --gtest_output. */
return write_gtest_output_xml(argv[1] + sizeof(gtest_output_arg) - 1);
}