From 9bf61d6a0dc36008034442db30697ee88530544e Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Sun, 26 May 2024 00:27:14 +0000 Subject: [PATCH] deps: update googletest to 305e5a2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/53157 Reviewed-By: Marco Ippolito Reviewed-By: Michaël Zasso Reviewed-By: Luigi Pinca Reviewed-By: Ulises Gascón Reviewed-By: Rafael Gonzaga Reviewed-By: Tobias Nießen Reviewed-By: Michael Dawson Reviewed-By: James M Snell --- deps/googletest/src/gtest.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deps/googletest/src/gtest.cc b/deps/googletest/src/gtest.cc index d64c18d7fd1a8d..9a17180b353031 100644 --- a/deps/googletest/src/gtest.cc +++ b/deps/googletest/src/gtest.cc @@ -6700,17 +6700,17 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) { } if (remove_flag) { - // Shift the remainder of the argv list left by one. Note - // that argv has (*argc + 1) elements, the last one always being - // NULL. The following loop moves the trailing NULL element as - // well. - for (int j = i; j != *argc; j++) { - argv[j] = argv[j + 1]; + // Shift the remainder of the argv list left by one. + for (int j = i + 1; j < *argc; ++j) { + argv[j - 1] = argv[j]; } // Decrements the argument count. (*argc)--; + // Terminate the array with nullptr. + argv[*argc] = nullptr; + // We also need to decrement the iterator as we just removed // an element. i--;