Skip to content

Commit c01ce60

Browse files
nodejs-github-botmarco-ippolito
authored andcommittedAug 19, 2024
deps: update googletest to 305e5a2
PR-URL: #53157 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 51e736a commit c01ce60

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

Diff for: ‎deps/googletest/src/gtest.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -6700,17 +6700,17 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
67006700
}
67016701

67026702
if (remove_flag) {
6703-
// Shift the remainder of the argv list left by one. Note
6704-
// that argv has (*argc + 1) elements, the last one always being
6705-
// NULL. The following loop moves the trailing NULL element as
6706-
// well.
6707-
for (int j = i; j != *argc; j++) {
6708-
argv[j] = argv[j + 1];
6703+
// Shift the remainder of the argv list left by one.
6704+
for (int j = i + 1; j < *argc; ++j) {
6705+
argv[j - 1] = argv[j];
67096706
}
67106707

67116708
// Decrements the argument count.
67126709
(*argc)--;
67136710

6711+
// Terminate the array with nullptr.
6712+
argv[*argc] = nullptr;
6713+
67146714
// We also need to decrement the iterator as we just removed
67156715
// an element.
67166716
i--;

0 commit comments

Comments
 (0)