diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-16 16:15:27 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-23 16:05:01 +0100 |
commit | 7d9d134bf95cb6a2ce9623c7e6a3535432a61af2 (patch) | |
tree | eeca53e065947846648d9373f240d593c0c0ecfc /src/util.cpp | |
parent | b77dfdc9e36e308aa806d63aa3b5628971789d5a (diff) |
Remove redundant .c_str()s
After the tinyformat switch sprintf() family functions support passing
actual std::string objects.
Remove unnecessary c_str calls (236 of them) in logging and formatting.
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util.cpp b/src/util.cpp index dd96ae0d70..255226ea1e 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -945,13 +945,13 @@ static std::string FormatException(std::exception* pex, const char* pszThread) void LogException(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); - LogPrintf("\n%s", message.c_str()); + LogPrintf("\n%s", message); } void PrintException(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); - LogPrintf("\n\n************************\n%s\n", message.c_str()); + LogPrintf("\n\n************************\n%s\n", message); fprintf(stderr, "\n\n************************\n%s\n", message.c_str()); strMiscWarning = message; throw; @@ -960,7 +960,7 @@ void PrintException(std::exception* pex, const char* pszThread) void PrintExceptionContinue(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); - LogPrintf("\n\n************************\n%s\n", message.c_str()); + LogPrintf("\n\n************************\n%s\n", message); fprintf(stderr, "\n\n************************\n%s\n", message.c_str()); strMiscWarning = message; } @@ -1305,7 +1305,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nTime) fDone = true; string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly."); strMiscWarning = strMessage; - LogPrintf("*** %s\n", strMessage.c_str()); + LogPrintf("*** %s\n", strMessage); uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING); } } @@ -1408,7 +1408,7 @@ void runCommand(std::string strCommand) { int nErr = ::system(strCommand.c_str()); if (nErr) - LogPrintf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr); + LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, nErr); } void RenameThread(const char* name) |