Bug 1060419 - make nsFrame.cpp use VsprintfLiteral, r?froydnj
MozReview-Commit-ID: 8g4E4mLj289
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -10344,17 +10344,17 @@ nsFrame::Trace(const char* aMethod, bool
void
nsFrame::TraceMsg(const char* aFormatString, ...)
{
if (NS_FRAME_LOG_TEST(sFrameLogModule, NS_FRAME_TRACE_CALLS)) {
// Format arguments into a buffer
char argbuf[200];
va_list ap;
va_start(ap, aFormatString);
- PR_vsnprintf(argbuf, sizeof(argbuf), aFormatString, ap);
+ VsprintfLiteral(argbuf, aFormatString, ap);
va_end(ap);
char tagbuf[40];
GetTagName(this, mContent, sizeof(tagbuf), tagbuf);
PR_LogPrint("%s: %s", tagbuf, argbuf);
}
}
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -474,17 +474,17 @@ public:
/**
* Tracing method that writes a method enter/exit routine to the
* nspr log using the nsIFrame log module. The tracing is only
* done when the NS_FRAME_TRACE_CALLS bit is set in the log module's
* level field.
*/
void Trace(const char* aMethod, bool aEnter);
void Trace(const char* aMethod, bool aEnter, nsReflowStatus aStatus);
- void TraceMsg(const char* fmt, ...);
+ void TraceMsg(const char* fmt, ...) MOZ_FORMAT_PRINTF(2, 3);
// Helper function that verifies that each frame in the list has the
// NS_FRAME_IS_DIRTY bit set
static void VerifyDirtyBitSet(const nsFrameList& aFrameList);
static void XMLQuote(nsString& aString);
/**