Bug 1060419 - make nsEnvironment.cpp use Printf.h, r=froydnj
authorTom Tromey <tom@tromey.com>
Fri, 09 Dec 2016 10:53:59 -1000
changeset 372572 fee2788f109a4e898ddeaa74d63f5a877676afa4
parent 372571 90b1959687b2adc7f5db7d9ea1a388c92ae6cdff
child 372573 86fcf8b658e4708128463bb9572ccdd0cf490bb9
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 nsEnvironment.cpp use Printf.h, r=froydnj MozReview-Commit-ID: 9GnlfmGm0LH
xpcom/threads/nsEnvironment.cpp
--- a/xpcom/threads/nsEnvironment.cpp
+++ b/xpcom/threads/nsEnvironment.cpp
@@ -1,22 +1,22 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsEnvironment.h"
 #include "prenv.h"
-#include "prprf.h"
 #include "nsBaseHashtable.h"
 #include "nsHashKeys.h"
 #include "nsPromiseFlatString.h"
 #include "nsDependentString.h"
 #include "nsNativeCharsetUtils.h"
+#include "mozilla/Printf.h"
 
 using namespace mozilla;
 
 NS_IMPL_ISUPPORTS(nsEnvironment, nsIEnvironment)
 
 nsresult
 nsEnvironment::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult)
 {
@@ -140,24 +140,24 @@ nsEnvironment::Set(const nsAString& aNam
     return NS_ERROR_UNEXPECTED;
   }
 
   EnvEntryType* entry = gEnvHash->PutEntry(nativeName.get());
   if (!entry) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  char* newData = PR_smprintf("%s=%s",
-                              nativeName.get(),
-                              nativeVal.get());
+  char* newData = mozilla::Smprintf("%s=%s",
+                             nativeName.get(),
+                             nativeVal.get());
   if (!newData) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   PR_SetEnv(newData);
   if (entry->mData) {
-    PR_smprintf_free(entry->mData);
+    mozilla::SmprintfFree(entry->mData);
   }
   entry->mData = newData;
   return NS_OK;
 }