Bug 1060419 - make nsWebBrowserPersist.cpp use Printf.h, r=froydnj
authorTom Tromey <tom@tromey.com>
Fri, 09 Dec 2016 14:01:49 -1000
changeset 372575 b3f9f7708dbd2c75b31f9fc173e0bbeaffd147a3
parent 372574 d89766e9ee6006ab37e97ef14d26be12e01ac0cc
child 372576 11812794175e5614b7025cb7a25fa7037da88890
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 nsWebBrowserPersist.cpp use Printf.h, r=froydnj MozReview-Commit-ID: BaIdoPZqFqg
dom/webbrowserpersist/nsWebBrowserPersist.cpp
--- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp
+++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp
@@ -56,16 +56,17 @@
 #include "nsWebBrowserPersist.h"
 #include "WebBrowserPersistLocalDocument.h"
 
 #include "nsIContent.h"
 #include "nsIMIMEInfo.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/HTMLSharedElement.h"
 #include "mozilla/dom/HTMLSharedObjectElement.h"
+#include "mozilla/Printf.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 // Buffer file writes in 32kb chunks
 #define BUFFERED_OUTPUT_SIZE (1024 * 32)
 
 struct nsWebBrowserPersist::WalkData
@@ -2016,28 +2017,28 @@ nsWebBrowserPersist::CalculateUniqueFile
         while (true)
         {
             // Make a file name,
             // Foo become foo_001, foo_002, etc.
             // Empty files become _001, _002 etc.
 
             if (base.IsEmpty() || duplicateCounter > 1)
             {
-                char * tmp = PR_smprintf("_%03d", duplicateCounter);
+                char * tmp = mozilla::Smprintf("_%03d", duplicateCounter);
                 NS_ENSURE_TRUE(tmp, NS_ERROR_OUT_OF_MEMORY);
                 if (filename.Length() < kDefaultMaxFilenameLength - 4)
                 {
                     tmpBase = base;
                 }
                 else
                 {
                     base.Mid(tmpBase, 0, base.Length() - 4);
                 }
                 tmpBase.Append(tmp);
-                PR_smprintf_free(tmp);
+                mozilla::SmprintfFree(tmp);
             }
             else
             {
                 tmpBase = base;
             }
 
             tmpPath.Assign(directory);
             tmpPath.Append(tmpBase);