diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-24 01:03:51 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-24 14:44:07 +0200 |
commit | 13645c5e1a819cebbda3e8021ad12884f2681ce5 (patch) | |
tree | 3c32e1bcdb8dcba9b428f88c015cd3f8171432ed | |
parent | f8af95f797c9dd4bac4b114cfcd73ed74ff8499d (diff) | |
download | mxs-utils-13645c5e1a819cebbda3e8021ad12884f2681ce5.tar.gz mxs-utils-13645c5e1a819cebbda3e8021ad12884f2681ce5.tar.xz |
fix printf
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | common/Logging.cpp | 2 | ||||
-rw-r--r-- | 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 = |