From 7bbab6889d2424f24c9aeaad0e10c9999874a0d1 Mon Sep 17 00:00:00 2001 From: gabime Date: Sun, 21 May 2017 02:07:43 +0300 Subject: [PATCH] use data() istead of c_str() in ansicolor_sink --- include/spdlog/sinks/ansicolor_sink.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/spdlog/sinks/ansicolor_sink.h b/include/spdlog/sinks/ansicolor_sink.h index b223d69f..ee18140e 100644 --- a/include/spdlog/sinks/ansicolor_sink.h +++ b/include/spdlog/sinks/ansicolor_sink.h @@ -1,5 +1,5 @@ // -// Copyright(c) 2016 Kevin M. Godby (a modified version by spdlog). +// Copyright(c) 2017 spdlog authors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) // @@ -56,9 +56,9 @@ protected: { const std::string& prefix = colors_[msg.level]; const std::string& reset = colors_[level::off]; - fwrite(prefix.c_str(), sizeof(char), prefix.size(), target_file_); + fwrite(prefix.data(), sizeof(char), prefix.size(), target_file_); fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), target_file_); - fwrite(reset.c_str(), sizeof(char), reset.size(), target_file_); + fwrite(reset.data(), sizeof(char), reset.size(), target_file_); } else {