diff --git a/src/googletest.h b/src/googletest.h index f06be8491..51e05dc71 100644 --- a/src/googletest.h +++ b/src/googletest.h @@ -467,7 +467,7 @@ static inline void StringReplace(string* str, const string& newsub) { size_t pos = str->find(oldsub); if (pos != string::npos) { - str->replace(pos, oldsub.size(), newsub.c_str()); + str->replace(pos, oldsub.size(), newsub); } } diff --git a/src/logging.cc b/src/logging.cc index 2e19c6234..4f7066d5a 100644 --- a/src/logging.cc +++ b/src/logging.cc @@ -1660,7 +1660,7 @@ void LogMessage::Init(const char* file, char fileline[128]; snprintf(fileline, sizeof(fileline), "%s:%d", data_->basename_, line); #ifdef HAVE_STACKTRACE - if (!strcmp(FLAGS_log_backtrace_at.c_str(), fileline)) { + if (FLAGS_log_backtrace_at == fileline) { string stacktrace; DumpStackTraceToString(&stacktrace); stream() << " (stacktrace:\n" << stacktrace << ") "; @@ -2288,7 +2288,7 @@ const vector& GetLoggingDirectories() { if ( !FLAGS_log_dir.empty() ) { // A dir was specified, we should use it - logging_directories_list->push_back(FLAGS_log_dir.c_str()); + logging_directories_list->push_back(FLAGS_log_dir); } else { GetTempDirectories(logging_directories_list); #ifdef GLOG_OS_WINDOWS