Bug 1060419 - make nsFrame.cpp use VsprintfLiteral, r?froydnj draft
authorTom Tromey <tom@tromey.com>
Fri, 09 Dec 2016 14:03:53 -1000
changeset 486160 b4379a4c931cf109a41ed9209c22112b493727c3
parent 486159 e2c58275924f56382e0a68208401b8652f7a6afb
child 486161 354ca160d32298d44540865a6dad2722a7d347ae
push id45909
push userbmo:ttromey@mozilla.com
push dateFri, 17 Feb 2017 16:00:11 +0000
reviewersfroydnj
bugs1060419
milestone54.0a1
Bug 1060419 - make nsFrame.cpp use VsprintfLiteral, r?froydnj MozReview-Commit-ID: 8g4E4mLj289
layout/generic/nsFrame.cpp
layout/generic/nsFrame.h
--- 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);
 
   /**