diff --git a/include/sta/Report.hh b/include/sta/Report.hh index d302aee9..10d546ce 100644 --- a/include/sta/Report.hh +++ b/include/sta/Report.hh @@ -125,7 +125,7 @@ protected: // Primitive to print output on the console. // Return the number of characters written. virtual size_t printConsole(const char *buffer, - size_t length) = 0; + size_t length); void printToBuffer(const char *fmt, ...) __attribute__((format (printf, 2, 3))); diff --git a/util/Debug.cc b/util/Debug.cc index 0bd81ead..daf47bba 100644 --- a/util/Debug.cc +++ b/util/Debug.cc @@ -109,7 +109,7 @@ Debug::reportLine(const char *what, { va_list args; va_start(args, fmt); - report_->printToBuffer(what); + report_->printToBuffer("%s", what); report_->printToBufferAppend(": "); report_->printToBufferAppend(fmt, args); report_->printBufferLine(); diff --git a/util/Report.cc b/util/Report.cc index cde8b023..f8203e4c 100644 --- a/util/Report.cc +++ b/util/Report.cc @@ -44,6 +44,14 @@ Report::~Report() delete [] buffer_; } +size_t +Report::printConsole(const char *buffer, + size_t length) +{ + printf("%s", buffer); + return length; +} + void Report::printLine(const char *line, size_t length) @@ -276,7 +284,7 @@ Report::fileCritical(int /* id */, { va_list args; va_start(args, fmt); - printToBuffer("Critical: %s line %d, ", filename, line, fmt, args); + printToBuffer("Critical: %s line %d, ", filename, line); printToBufferAppend(fmt, args); printBufferLine(); va_end(args);