Bug 1060419 - make nsFrame.cpp use VsprintfLiteral, r=froydnj
authorTom Tromey <tom@tromey.com>
Fri, 09 Dec 2016 14:03:53 -1000
changeset 372576 11812794175e5614b7025cb7a25fa7037da88890
parent 372575 b3f9f7708dbd2c75b31f9fc173e0bbeaffd147a3
child 372577 c6e12df0792f6c532982860663bb55a122d4f1e6
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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);
 
   /**