summaryrefslogtreecommitdiff
path: root/test/cctest
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2017-03-29 07:36:55 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2017-03-31 07:15:24 +0200
commit92de91d57029a61bcd5284d4ef345b26ca83237d (patch)
tree0b4277dd4db4742807833e3edb4c447628732e62 /test/cctest
parentb08490774df725127798745bfb21fda0ebf36f71 (diff)
downloadandroid-node-v8-92de91d57029a61bcd5284d4ef345b26ca83237d.tar.gz
android-node-v8-92de91d57029a61bcd5284d4ef345b26ca83237d.tar.bz2
android-node-v8-92de91d57029a61bcd5284d4ef345b26ca83237d.zip
test: fix truncation of argv
Currently argv_[1] and argv_[2] are getting truncated by one character because of an incorrect addition of one to account for the null character. I only noticed this when working on #12087, but that fix will probably not get included in favor of a JavaScript test so I'm adding this separate commit for it. Refs: https://github.com/nodejs/node/pull/12087 PR-URL: https://github.com/nodejs/node/pull/12110 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'test/cctest')
-rw-r--r--test/cctest/node_test_fixture.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h
index de79b18685..48440b379e 100644
--- a/test/cctest/node_test_fixture.h
+++ b/test/cctest/node_test_fixture.h
@@ -41,8 +41,8 @@ struct Argv {
snprintf(argv_[0], prog_len, "%s", prog);
snprintf(argv_[0] + prog_len, arg1_len, "%s", arg1);
snprintf(argv_[0] + prog_len + arg1_len, arg2_len, "%s", arg2);
- argv_[1] = argv_[0] + prog_len + 1;
- argv_[2] = argv_[0] + prog_len + arg1_len + 1;
+ argv_[1] = argv_[0] + prog_len;
+ argv_[2] = argv_[0] + prog_len + arg1_len;
}
~Argv() {