From 13645c5e1a819cebbda3e8021ad12884f2681ce5 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Fri, 24 Jun 2011 01:03:51 +0200 Subject: fix printf Signed-off-by: Michael Olbrich --- common/Logging.cpp | 2 +- elftosb2/ElftosbAST.cpp | 30 ++---------------------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/common/Logging.cpp b/common/Logging.cpp index f6d3906..4ba3d7a 100644 --- a/common/Logging.cpp +++ b/common/Logging.cpp @@ -86,6 +86,6 @@ void Log::log(Logger::log_level_t level, const std::string & msg) void StdoutLogger::_log(const char * msg) { - printf(msg); + printf("%s", msg); } diff --git a/elftosb2/ElftosbAST.cpp b/elftosb2/ElftosbAST.cpp index 749da62..19efe57 100644 --- a/elftosb2/ElftosbAST.cpp +++ b/elftosb2/ElftosbAST.cpp @@ -1201,15 +1201,7 @@ void SectionMatchListASTNode::printTree(int indent) const } printIndent(indent+1); - printf("source: ", m_source->c_str()); - if (m_source) - { - printf("%s\n", m_source->c_str()); - } - else - { - printf("\n"); - } + printf("source: %s\n", m_source ? m_source->c_str() : ""); } #pragma mark = SectionASTNode = @@ -1280,25 +1272,7 @@ void SymbolASTNode::printTree(int indent) const source = m_source->c_str(); } - printf("%s(", nodeName().c_str()); - if (source) - { - printf(source); - } - else - { - printf("."); - } - printf(":"); - if (symbol) - { - printf(symbol); - } - else - { - printf("."); - } - printf(")\n"); + printf("%s(%s:%s)\n", nodeName().c_str(), source ? source: ".", symbol ? symbol : "."); } #pragma mark = AddressRangeASTNode = -- cgit v1.2.3