diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc index 902d8c7f..73a352ff 100644 --- a/googletest/src/gtest-filepath.cc +++ b/googletest/src/gtest-filepath.cc @@ -325,7 +325,7 @@ FilePath FilePath::GenerateUniqueFileName(const FilePath& directory, // This does NOT check that a directory (or file) actually exists. bool FilePath::IsDirectory() const { return !pathname_.empty() && - IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]); + IsPathSeparator(pathname_[pathname_.length() - 1]); } // Create directories so that path exists. Returns true if successful or if diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index 68f77f71..e37a8bb1 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -1143,7 +1143,7 @@ static std::string FlagToEnvVar(const char* flag) { Message env_var; for (size_t i = 0; i != full_flag.length(); i++) { - env_var << ToUpper(full_flag.c_str()[i]); + env_var << ToUpper(full_flag[i]); } return env_var.GetString();