Bug 1060419 - make nsWebBrowserPersist.cpp use Printf.h, r?froydnj
MozReview-Commit-ID: BaIdoPZqFqg
--- 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);