Bug 1060419 - make nsWebBrowserPersist.cpp use Printf.h, r=froydnj

MozReview-Commit-ID: BaIdoPZqFqg

--HG--
extra : rebase_source : 52b71d49bc8cb9a59693ec1e5b79389c2dbd931a
This commit is contained in:
Tom Tromey 2016-12-09 14:01:49 -10:00
parent aa2c6e6ff5
commit 6d016346f9

View File

@ -61,6 +61,7 @@
#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;
@ -2021,7 +2022,7 @@ nsWebBrowserPersist::CalculateUniqueFilename(nsIURI *aURI)
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)
{
@ -2032,7 +2033,7 @@ nsWebBrowserPersist::CalculateUniqueFilename(nsIURI *aURI)
base.Mid(tmpBase, 0, base.Length() - 4);
}
tmpBase.Append(tmp);
PR_smprintf_free(tmp);
mozilla::SmprintfFree(tmp);
}
else
{