Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj
authorIgor <palmieri.igor@gmail.com>
Sun, 14 Aug 2016 23:44:00 -0700
changeset 400687 86fac0f27d7dc7b464edaabd0629b248dbfde9bb
parent 400686 231c74115211681d0a4b1692513fbb7f1d60a36a
child 400688 f881b700b183e9c4bb83cd9e0ae450082fb947e9
push id26245
push userbmo:till@tillschneidereit.net
push dateMon, 15 Aug 2016 14:02:13 +0000
reviewersfroydnj
bugs1293384
milestone51.0a1
Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj
accessible/atk/AccessibleWrap.cpp
dom/base/FragmentOrElement.cpp
dom/base/NodeInfo.cpp
dom/base/nsDocument.cpp
dom/base/nsGenericDOMDataNode.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsXMLContentSerializer.cpp
dom/bindings/BindingUtils.cpp
dom/events/DOMEventTargetHelper.cpp
dom/ipc/CrashReporterParent.cpp
dom/media/AudioStream.cpp
dom/media/MediaManager.cpp
dom/media/mediasource/ResourceQueue.cpp
dom/media/webm/WebMDemuxer.cpp
dom/system/gonk/NetworkUtils.cpp
dom/wifi/WifiHotspotUtils.cpp
dom/wifi/WifiUtils.cpp
gfx/layers/composite/FPSCounter.cpp
gfx/tests/gtest/TestColorNames.cpp
gfx/thebes/gfxFontUtils.cpp
gfx/thebes/gfxHarfBuzzShaper.cpp
gfx/thebes/gfxTextRun.cpp
gfx/thebes/gfxWindowsPlatform.cpp
image/decoders/icon/nsIconURI.cpp
intl/locale/nsScriptableDateFormat.cpp
intl/locale/unix/nsPosixLocale.cpp
ipc/glue/GeckoChildProcessHost.cpp
ipc/glue/MessageChannel.cpp
ipc/netd/Netd.cpp
js/src/builtin/TestingFunctions.cpp
js/src/ctypes/CTypes.cpp
js/src/gc/Statistics.cpp
js/src/jsdate.cpp
js/src/jsopcode.cpp
js/src/jsprf.cpp
js/src/shell/js.cpp
layout/base/nsPresShell.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsFrame.cpp
layout/mathml/nsMathMLChar.cpp
layout/style/FontFaceSet.cpp
layout/style/nsCSSParser.cpp
mfbt/JSONWriter.h
mfbt/Snprintf.h
mfbt/tests/TestIntegerPrintfMacros.cpp
mozglue/misc/TimeStamp_posix.cpp
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cache/nsDiskCacheMap.cpp
netwerk/protocol/rtsp/rtsp/ASessionDescription.cpp
netwerk/streamconv/converters/ParseFTPList.cpp
netwerk/test/PropertiesTest.cpp
netwerk/test/urltest.cpp
security/manager/ssl/nsNSSCertHelper.cpp
testing/mochitest/ssltunnel/ssltunnel.cpp
toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
toolkit/crashreporter/nsExceptionHandler.cpp
tools/profiler/core/ProfilerMarkers.cpp
tools/profiler/lul/LulDwarf.cpp
tools/profiler/lul/LulDwarfSummariser.cpp
tools/profiler/lul/LulMain.cpp
widget/nsBaseWidget.cpp
widget/xremoteclient/XRemoteClient.cpp
xpcom/base/CycleCollectedJSRuntime.cpp
xpcom/base/Logging.cpp
xpcom/ds/nsSupportsPrimitives.cpp
xpcom/glue/nsID.cpp
xpcom/threads/ThreadStackHelper.cpp
xpfe/appshell/nsXULWindow.cpp
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -431,17 +431,17 @@ GetMaiAtkType(uint16_t interfacesBits)
 static const char*
 GetUniqueMaiAtkTypeName(uint16_t interfacesBits)
 {
 #define MAI_ATK_TYPE_NAME_LEN (30)     /* 10+sizeof(uint16_t)*8/4+1 < 30 */
 
     static gchar namePrefix[] = "MaiAtkType";   /* size = 10 */
     static gchar name[MAI_ATK_TYPE_NAME_LEN + 1];
 
-    snprintf_literal(name, "%s%x", namePrefix, interfacesBits);
+    SprintfLiteral(name, "%s%x", namePrefix, interfacesBits);
     name[MAI_ATK_TYPE_NAME_LEN] = '\0';
 
     return name;
 }
 
 bool
 AccessibleWrap::IsValidObject()
 {
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -1889,23 +1889,23 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
     if (!tmp->IsInUncomposedDoc() &&
         // Ignore xbl:content, which is never in the document and hence always
         // appears to be orphaned.
         !tmp->NodeInfo()->Equals(nsGkAtoms::content, kNameSpaceID_XBL)) {
       orphan.AppendLiteral(" (orphan)");
     }
 
     const char* nsuri = nsid < ArrayLength(kNSURIs) ? kNSURIs[nsid] : "";
-    snprintf_literal(name, "FragmentOrElement%s %s%s%s%s %s",
-                     nsuri,
-                     localName.get(),
-                     NS_ConvertUTF16toUTF8(id).get(),
-                     NS_ConvertUTF16toUTF8(classes).get(),
-                     orphan.get(),
-                     uri.get());
+    SprintfLiteral(name, "FragmentOrElement%s %s%s%s%s %s",
+                   nsuri,
+                   localName.get(),
+                   NS_ConvertUTF16toUTF8(id).get(),
+                   NS_ConvertUTF16toUTF8(classes).get(),
+                   orphan.get(),
+                   uri.get());
     cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
   }
   else {
     NS_IMPL_CYCLE_COLLECTION_DESCRIBE(FragmentOrElement, tmp->mRefCnt.get())
   }
 
   // Always need to traverse script objects, so do that before we check
   // if we're uncollectable.
--- a/dom/base/NodeInfo.cpp
+++ b/dom/base/NodeInfo.cpp
@@ -124,21 +124,21 @@ static const char* kNodeInfoNSURIs[] = {
 };
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(NodeInfo)
   if (MOZ_UNLIKELY(cb.WantDebugInfo())) {
     char name[72];
     uint32_t nsid = tmp->NamespaceID();
     nsAtomCString localName(tmp->NameAtom());
     if (nsid < ArrayLength(kNodeInfoNSURIs)) {
-      snprintf_literal(name, "NodeInfo%s %s", kNodeInfoNSURIs[nsid],
-                       localName.get());
+      SprintfLiteral(name, "NodeInfo%s %s", kNodeInfoNSURIs[nsid],
+                     localName.get());
     }
     else {
-      snprintf_literal(name, "NodeInfo %s", localName.get());
+      SprintfLiteral(name, "NodeInfo %s", localName.get());
     }
 
     cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
   }
   else {
     NS_IMPL_CYCLE_COLLECTION_DESCRIBE(NodeInfo, tmp->mRefCnt.get())
   }
 
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1758,22 +1758,22 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
     } else {
       loadedAsData.AssignLiteral("normal");
     }
     uint32_t nsid = tmp->GetDefaultNamespaceID();
     nsAutoCString uri;
     if (tmp->mDocumentURI)
       tmp->mDocumentURI->GetSpec(uri);
     if (nsid < ArrayLength(kNSURIs)) {
-      snprintf_literal(name, "nsDocument %s %s %s",
-                       loadedAsData.get(), kNSURIs[nsid], uri.get());
+      SprintfLiteral(name, "nsDocument %s %s %s",
+                     loadedAsData.get(), kNSURIs[nsid], uri.get());
     }
     else {
-      snprintf_literal(name, "nsDocument %s %s",
-                       loadedAsData.get(), uri.get());
+      SprintfLiteral(name, "nsDocument %s %s",
+                     loadedAsData.get(), uri.get());
     }
     cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
   }
   else {
     NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsDocument, tmp->mRefCnt.get())
   }
 
   // Always need to traverse script objects, so do that before we check
@@ -2945,19 +2945,19 @@ nsDocument::GetLastModified(nsAString& a
 
 static void
 GetFormattedTimeString(PRTime aTime, nsAString& aFormattedTimeString)
 {
   PRExplodedTime prtime;
   PR_ExplodeTime(aTime, PR_LocalTimeParameters, &prtime);
   // "MM/DD/YYYY hh:mm:ss"
   char formatedTime[24];
-  if (snprintf_literal(formatedTime, "%02d/%02d/%04d %02d:%02d:%02d",
-                       prtime.tm_month + 1, prtime.tm_mday, int(prtime.tm_year),
-                       prtime.tm_hour     ,  prtime.tm_min,  prtime.tm_sec)) {
+  if (SprintfLiteral(formatedTime, "%02d/%02d/%04d %02d:%02d:%02d",
+                     prtime.tm_month + 1, prtime.tm_mday, int(prtime.tm_year),
+                     prtime.tm_hour     ,  prtime.tm_min,  prtime.tm_sec)) {
     CopyASCIItoUTF16(nsDependentCString(formatedTime), aFormattedTimeString);
   } else {
     // If we for whatever reason failed to find the last modified time
     // (or even the current time), fall back to what NS4.x returned.
     aFormattedTimeString.AssignLiteral(u"01/01/1970 00:00:00");
   }
 }
 
--- a/dom/base/nsGenericDOMDataNode.cpp
+++ b/dom/base/nsGenericDOMDataNode.cpp
@@ -86,18 +86,18 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsGenericDOMDataNode)
   return Element::CanSkipThis(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericDOMDataNode)
   if (MOZ_UNLIKELY(cb.WantDebugInfo())) {
     char name[40];
-    snprintf_literal(name, "nsGenericDOMDataNode (len=%d)",
-                     tmp->mText.GetLength());
+    SprintfLiteral(name, "nsGenericDOMDataNode (len=%d)",
+                   tmp->mText.GetLength());
     cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
   } else {
     NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsGenericDOMDataNode, tmp->mRefCnt.get())
   }
 
   // Always need to traverse script objects, so do that before we check
   // if we're uncollectable.
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
@@ -425,17 +425,17 @@ nsGenericDOMDataNode::ToCString(nsAStrin
       if (ch == '&') {
         aBuf.AppendLiteral("&amp;");
       } else if (ch == '<') {
         aBuf.AppendLiteral("&lt;");
       } else if (ch == '>') {
         aBuf.AppendLiteral("&gt;");
       } else if ((ch < ' ') || (ch >= 127)) {
         char buf[10];
-        snprintf_literal(buf, "\\u%04x", ch);
+        SprintfLiteral(buf, "\\u%04x", ch);
         AppendASCIItoUTF16(buf, aBuf);
       } else {
         aBuf.Append(ch);
       }
     }
   } else {
     unsigned char* cp = (unsigned char*)mText.Get1b() + aOffset;
     const unsigned char* end = cp + aLen;
@@ -445,17 +445,17 @@ nsGenericDOMDataNode::ToCString(nsAStrin
       if (ch == '&') {
         aBuf.AppendLiteral("&amp;");
       } else if (ch == '<') {
         aBuf.AppendLiteral("&lt;");
       } else if (ch == '>') {
         aBuf.AppendLiteral("&gt;");
       } else if ((ch < ' ') || (ch >= 127)) {
         char buf[10];
-        snprintf_literal(buf, "\\u%04x", ch);
+        SprintfLiteral(buf, "\\u%04x", ch);
         AppendASCIItoUTF16(buf, aBuf);
       } else {
         aBuf.Append(ch);
       }
     }
   }
 }
 #endif
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -1840,18 +1840,18 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsGlobalW
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindow)
   if (MOZ_UNLIKELY(cb.WantDebugInfo())) {
     char name[512];
     nsAutoCString uri;
     if (tmp->mDoc && tmp->mDoc->GetDocumentURI()) {
       tmp->mDoc->GetDocumentURI()->GetSpec(uri);
     }
-    snprintf_literal(name, "nsGlobalWindow # %" PRIu64 " %s %s", tmp->mWindowID,
-                     tmp->IsInnerWindow() ? "inner" : "outer", uri.get());
+    SprintfLiteral(name, "nsGlobalWindow # %" PRIu64 " %s %s", tmp->mWindowID,
+                   tmp->IsInnerWindow() ? "inner" : "outer", uri.get());
     cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
   } else {
     NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsGlobalWindow, tmp->mRefCnt.get())
   }
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContext)
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mControllers)
--- a/dom/base/nsXMLContentSerializer.cpp
+++ b/dom/base/nsXMLContentSerializer.cpp
@@ -603,17 +603,17 @@ nsXMLContentSerializer::ConfirmPrefix(ns
   return true;
 }
 
 void
 nsXMLContentSerializer::GenerateNewPrefix(nsAString& aPrefix)
 {
   aPrefix.Assign('a');
   char buf[128];
-  snprintf_literal(buf, "%d", mPrefixIndex++);
+  SprintfLiteral(buf, "%d", mPrefixIndex++);
   AppendASCIItoUTF16(buf, aPrefix);
 }
 
 bool
 nsXMLContentSerializer::SerializeAttr(const nsAString& aPrefix,
                                       const nsAString& aName,
                                       const nsAString& aValue,
                                       nsAString& aStr,
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -2569,23 +2569,23 @@ ConvertJSValueToByteString(JSContext* cx
 
     if (foundBadChar) {
       MOZ_ASSERT(badCharIndex < length);
       MOZ_ASSERT(badChar > 255);
       // The largest unsigned 64 bit number (18,446,744,073,709,551,615) has
       // 20 digits, plus one more for the null terminator.
       char index[21];
       static_assert(sizeof(size_t) <= 8, "index array too small");
-      snprintf_literal(index, "%" PRIuSIZE, badCharIndex);
+      SprintfLiteral(index, "%" PRIuSIZE, badCharIndex);
       // A char16_t is 16 bits long.  The biggest unsigned 16 bit
       // number (65,535) has 5 digits, plus one more for the null
       // terminator.
       char badCharArray[6];
       static_assert(sizeof(char16_t) <= 2, "badCharArray too small");
-      snprintf_literal(badCharArray, "%d", badChar);
+      SprintfLiteral(badCharArray, "%d", badChar);
       ThrowErrorMessage(cx, MSG_INVALID_BYTESTRING, index, badCharArray);
       return false;
     }
   } else {
     length = js::GetStringLength(s);
   }
 
   static_assert(js::MaxStringLength < UINT32_MAX,
--- a/dom/events/DOMEventTargetHelper.cpp
+++ b/dom/events/DOMEventTargetHelper.cpp
@@ -30,19 +30,19 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
     nsAutoString uri;
     if (tmp->mOwnerWindow && tmp->mOwnerWindow->GetExtantDoc()) {
       tmp->mOwnerWindow->GetExtantDoc()->GetDocumentURI(uri);
     }
 
     nsXPCOMCycleCollectionParticipant* participant = nullptr;
     CallQueryInterface(tmp, &participant);
 
-    snprintf_literal(name, "%s %s",
-                     participant->ClassName(),
-                     NS_ConvertUTF16toUTF8(uri).get());
+    SprintfLiteral(name, "%s %s",
+                   participant->ClassName(),
+                   NS_ConvertUTF16toUTF8(uri).get());
     cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
   } else {
     NS_IMPL_CYCLE_COLLECTION_DESCRIBE(DOMEventTargetHelper, tmp->mRefCnt.get())
   }
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mListenerManager)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
--- a/dom/ipc/CrashReporterParent.cpp
+++ b/dom/ipc/CrashReporterParent.cpp
@@ -132,17 +132,17 @@ CrashReporterParent::GenerateChildData(c
       break;
     default:
       NS_ERROR("unknown process type");
       break;
   }
   mNotes.Put(NS_LITERAL_CSTRING("ProcessType"), type);
 
   char startTime[32];
-  snprintf_literal(startTime, "%lld", static_cast<long long>(mStartTime));
+  SprintfLiteral(startTime, "%lld", static_cast<long long>(mStartTime));
   mNotes.Put(NS_LITERAL_CSTRING("StartupTime"), nsDependentCString(startTime));
 
   if (!mAppNotes.IsEmpty()) {
     mNotes.Put(NS_LITERAL_CSTRING("Notes"), mAppNotes);
   }
 
   // Append these notes to the end of the extra file based on the current
   // dump id we obtained from CreatePairedMinidumps.
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -238,17 +238,17 @@ OpenDumpFile(uint32_t aChannels, uint32_
    * dumped-audio-<nnn>.wav, one per AudioStream created, containing
    * the audio for the stream including any skips due to underruns.
    */
   static Atomic<int> gDumpedAudioCount(0);
 
   if (!getenv("MOZ_DUMP_AUDIO"))
     return nullptr;
   char buf[100];
-  snprintf_literal(buf, "dumped-audio-%d.wav", ++gDumpedAudioCount);
+  SprintfLiteral(buf, "dumped-audio-%d.wav", ++gDumpedAudioCount);
   FILE* f = fopen(buf, "wb");
   if (!f)
     return nullptr;
 
   uint8_t header[] = {
     // RIFF header
     0x52, 0x49, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45,
     // fmt chunk. We always write 16-bit samples.
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -2762,17 +2762,17 @@ MediaManager::RemoveWindowID(uint64_t aW
     LOG(("No outer window for inner %llu", aWindowId));
     return;
   }
 
   uint64_t outerID = outer->WindowID();
 
   // Notify the UI that this window no longer has gUM active
   char windowBuffer[32];
-  snprintf_literal(windowBuffer, "%" PRIu64, outerID);
+  SprintfLiteral(windowBuffer, "%" PRIu64, outerID);
   nsString data = NS_ConvertUTF8toUTF16(windowBuffer);
 
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   obs->NotifyObservers(nullptr, "recording-window-ended", data.get());
   LOG(("Sent recording-window-ended for window %llu (outer %llu)",
        aWindowId, outerID));
 }
 
--- a/dom/media/mediasource/ResourceQueue.cpp
+++ b/dom/media/mediasource/ResourceQueue.cpp
@@ -160,17 +160,17 @@ ResourceQueue::SizeOfExcludingThis(Mallo
 #if defined(DEBUG)
 void
 ResourceQueue::Dump(const char* aPath)
 {
   for (uint32_t i = 0; i < uint32_t(GetSize()); ++i) {
     ResourceItem* item = ResourceAt(i);
 
     char buf[255];
-    snprintf_literal(buf, "%s/%08u.bin", aPath, i);
+    SprintfLiteral(buf, "%s/%08u.bin", aPath, i);
     FILE* fp = fopen(buf, "wb");
     if (!fp) {
       return;
     }
     fwrite(item->mData->Elements(), item->mData->Length(), 1, fp);
     fclose(fp);
   }
 }
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -118,17 +118,17 @@ static void webmdemux_log(nestegg* aCont
       break;
     default:
       sevStr = "UNK";
       break;
   }
 
   va_start(args, aFormat);
 
-  snprintf_literal(msg, "%p [Nestegg-%s] ", aContext, sevStr);
+  SprintfLiteral(msg, "%p [Nestegg-%s] ", aContext, sevStr);
   PR_vsnprintf(msg+strlen(msg), sizeof(msg)-strlen(msg), aFormat, args);
   MOZ_LOG(gNesteggLog, LogLevel::Debug, (msg));
 
   va_end(args);
 }
 
 WebMDemuxer::NestEggContext::~NestEggContext()
 {
--- a/dom/system/gonk/NetworkUtils.cpp
+++ b/dom/system/gonk/NetworkUtils.cpp
@@ -1170,21 +1170,21 @@ void NetworkUtils::removeDefaultRoute(Co
 void NetworkUtils::setInterfaceDns(CommandChain* aChain,
                                    CommandCallback aCallback,
                                    NetworkResultOptions& aResult)
 {
   char command[MAX_COMMAND_SIZE];
   int written;
 
   if (SDK_VERSION >= 20) {
-    written = snprintf_literal(command, "resolver setnetdns %d %s",
-                               GET_FIELD(mNetId), GET_CHAR(mDomain));
+    written = SprintfLiteral(command, "resolver setnetdns %d %s",
+                             GET_FIELD(mNetId), GET_CHAR(mDomain));
   } else {
-    written = snprintf_literal(command, "resolver setifdns %s %s",
-                               GET_CHAR(mIfname), GET_CHAR(mDomain));
+    written = SprintfLiteral(command, "resolver setifdns %s %s",
+                             GET_CHAR(mIfname), GET_CHAR(mDomain));
   }
 
   nsTArray<nsString>& dnses = GET_FIELD(mDnses);
   uint32_t length = dnses.Length();
 
   for (uint32_t i = 0; i < length; i++) {
     NS_ConvertUTF16toUTF8 autoDns(dnses[i]);
 
@@ -1952,17 +1952,17 @@ CommandResult NetworkUtils::setDNS(Netwo
 {
   uint32_t length = aOptions.mDnses.Length();
 
   if (length > 0) {
     for (uint32_t i = 0; i < length; i++) {
       NS_ConvertUTF16toUTF8 autoDns(aOptions.mDnses[i]);
 
       char dns_prop_key[Property::VALUE_MAX_LENGTH];
-      snprintf_literal(dns_prop_key, "net.dns%d", i+1);
+      SprintfLiteral(dns_prop_key, "net.dns%d", i+1);
       Property::Set(dns_prop_key, autoDns.get());
     }
   } else {
     // Set dnses from system properties.
     IFProperties interfaceProperties;
     getIFProperties(GET_CHAR(mIfname), interfaceProperties);
 
     Property::Set("net.dns1", interfaceProperties.dns1);
--- a/dom/wifi/WifiHotspotUtils.cpp
+++ b/dom/wifi/WifiHotspotUtils.cpp
@@ -173,16 +173,16 @@ int32_t WifiHotspotUtils::do_wifi_hostap
   int stations = 0;
   size_t addrLen = sizeof(addr);
 
   if (sendCommand(ctrl_conn, "STA-FIRST", addr, &addrLen)) {
     return 0;
   }
   stations++;
 
-  snprintf_literal(cmd, "STA-NEXT %s", addr);
+  SprintfLiteral(cmd, "STA-NEXT %s", addr);
   while (sendCommand(ctrl_conn, cmd, addr, &addrLen) == 0) {
     stations++;
-    snprintf_literal(cmd, "STA-NEXT %s", addr);
+    SprintfLiteral(cmd, "STA-NEXT %s", addr);
   }
 
   return stations;
 }
--- a/dom/wifi/WifiUtils.cpp
+++ b/dom/wifi/WifiUtils.cpp
@@ -364,20 +364,20 @@ public:
     return wifi_stop_supplicant(arg);
   }
 
   DEFINE_DLFUNC(wifi_command, int32_t, const char*, char*, size_t*)
   int32_t do_wifi_command(const char* iface, const char* cmd, char* buf, size_t* len) {
     char command[COMMAND_SIZE];
     if (!strcmp(iface, "p2p0")) {
       // Commands for p2p0 interface don't need prefix
-      snprintf_literal(command, "%s", cmd);
+      SprintfLiteral(command, "%s", cmd);
     }
     else {
-      snprintf_literal(command, "IFNAME=%s %s", iface, cmd);
+      SprintfLiteral(command, "IFNAME=%s %s", iface, cmd);
     }
     USE_DLFUNC(wifi_command)
     return wifi_command(command, buf, len);
   }
 };
 
 // Concrete class to use to access the wpa supplicant.
 WpaSupplicant::WpaSupplicant()
--- a/gfx/layers/composite/FPSCounter.cpp
+++ b/gfx/layers/composite/FPSCounter.cpp
@@ -204,32 +204,32 @@ FPSCounter::BuildHistogram(std::map<int,
 }
 
 // Iterate the same way we do in GetFPS()
 void
 FPSCounter::WriteFrameTimeStamps(PRFileDesc* fd)
 {
   const int bufferSize = 256;
   char buffer[bufferSize];
-  int writtenCount = snprintf_literal(buffer, "FPS Data for: %s\n", mFPSName);
+  int writtenCount = SprintfLiteral(buffer, "FPS Data for: %s\n", mFPSName);
   MOZ_ASSERT(writtenCount >= 0);
   PR_Write(fd, buffer, writtenCount);
 
   ResetReverseIterator();
   TimeStamp startTimeStamp = GetLatestTimeStamp();
 
   MOZ_ASSERT(HasNext(startTimeStamp));
   TimeStamp previousSample = GetNextTimeStamp();
 
   MOZ_ASSERT(HasNext(startTimeStamp));
   TimeStamp nextTimeStamp = GetNextTimeStamp();
 
   while (HasNext(startTimeStamp)) {
     TimeDuration duration = previousSample - nextTimeStamp;
-    writtenCount = snprintf_literal(buffer, "%f,\n", duration.ToMilliseconds());
+    writtenCount = SprintfLiteral(buffer, "%f,\n", duration.ToMilliseconds());
 
     MOZ_ASSERT(writtenCount >= 0);
     PR_Write(fd, buffer, writtenCount);
 
     previousSample = nextTimeStamp;
     nextTimeStamp = GetNextTimeStamp();
   }
 }
--- a/gfx/tests/gtest/TestColorNames.cpp
+++ b/gfx/tests/gtest/TestColorNames.cpp
@@ -63,19 +63,19 @@ void RunColorTests() {
 
     // Check that parsing an RGB value in hex gets the right values
     uint8_t r = NS_GET_R(rgb);
     uint8_t g = NS_GET_G(rgb);
     uint8_t b = NS_GET_B(rgb);
     uint8_t a = NS_GET_A(rgb);
     char cbuf[50];
     if (a != UINT8_MAX) {
-      snprintf_literal(cbuf, "%02x%02x%02x%02x", r, g, b, a);
+      SprintfLiteral(cbuf, "%02x%02x%02x%02x", r, g, b, a);
     } else {
-      snprintf_literal(cbuf, "%02x%02x%02x", r, g, b);
+      SprintfLiteral(cbuf, "%02x%02x%02x", r, g, b);
     }
     nscolor hexrgb;
     ASSERT_TRUE(NS_HexToRGBA(NS_ConvertASCIItoUTF16(cbuf),
                              nsHexColorType::AllowAlpha, &hexrgb)) <<
       "hex conversion to color of '" << cbuf << "'";
     ASSERT_TRUE(hexrgb == rgb);
   }
 }
--- a/gfx/thebes/gfxFontUtils.cpp
+++ b/gfx/thebes/gfxFontUtils.cpp
@@ -1412,18 +1412,18 @@ gfxFontUtils::DecodeFontName(const char 
     const char *csName = GetCharsetForFontName(aPlatformCode, aScriptCode, aLangCode);
 
     if (!csName) {
         // nullptr -> unknown charset
 #ifdef DEBUG
         char warnBuf[128];
         if (aByteLen > 64)
             aByteLen = 64;
-        snprintf_literal(warnBuf, "skipping font name, unknown charset %d:%d:%d for <%.*s>",
-                         aPlatformCode, aScriptCode, aLangCode, aByteLen, aNameData);
+        SprintfLiteral(warnBuf, "skipping font name, unknown charset %d:%d:%d for <%.*s>",
+                       aPlatformCode, aScriptCode, aLangCode, aByteLen, aNameData);
         NS_WARNING(warnBuf);
 #endif
         return false;
     }
 
     if (csName[0] == 0) {
         // empty charset name: data is utf16be, no need to instantiate a converter
         uint32_t strLen = aByteLen / 2;
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -925,20 +925,20 @@ gfxHarfBuzzShaper::GetHKerning(uint16_t 
                                  (coverage & KERN0_COVERAGE_MINIMUM) != 0);
                 break;
             default:
                 // TODO: implement support for other formats,
                 // if they're ever used in practice
 #if DEBUG
                 {
                     char buf[1024];
-                    snprintf_literal(buf, "unknown kern subtable in %s: "
-                                          "ver 0 format %d\n",
-                                     NS_ConvertUTF16toUTF8(mFont->GetName()).get(),
-                                     format);
+                    SprintfLiteral(buf, "unknown kern subtable in %s: "
+                                        "ver 0 format %d\n",
+                                   NS_ConvertUTF16toUTF8(mFont->GetName()).get(),
+                                   format);
                     NS_WARNING(buf);
                 }
 #endif
                 break;
             }
         }
     } else {
         // It wasn't a "version 0" table; check if it is Apple version 1.0
@@ -987,20 +987,20 @@ gfxHarfBuzzShaper::GetHKerning(uint16_t 
                 default:
                     // TODO: implement support for other formats.
                     // Note that format 1 cannot be supported here,
                     // as it requires the full glyph array to run the FSM,
                     // not just the current glyph pair.
 #if DEBUG
                     {
                         char buf[1024];
-                        snprintf_literal(buf, "unknown kern subtable in %s: "
-                                              "ver 0 format %d\n",
-                                         NS_ConvertUTF16toUTF8(mFont->GetName()).get(),
-                                         format);
+                        SprintfLiteral(buf, "unknown kern subtable in %s: "
+                                            "ver 0 format %d\n",
+                                       NS_ConvertUTF16toUTF8(mFont->GetName()).get(),
+                                       format);
                         NS_WARNING(buf);
                     }
 #endif
                     break;
                 }
             }
         }
     }
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -1869,18 +1869,18 @@ gfxFontGroup::GetDefaultFont()
         fontInitInfo.AppendPrintf(" backend: %s system-uptime: %9.3f sec",
                                   dwriteEnabled ? "directwrite" : "gdi", upTime/1000);
 #endif
         gfxCriticalError() << fontInitInfo.get();
 
         char msg[256]; // CHECK buffer length if revising message below
         nsAutoString familiesString;
         mFamilyList.ToString(familiesString);
-        snprintf_literal(msg, "unable to find a usable font (%.220s)",
-                         NS_ConvertUTF16toUTF8(familiesString).get());
+        SprintfLiteral(msg, "unable to find a usable font (%.220s)",
+                       NS_ConvertUTF16toUTF8(familiesString).get());
         NS_RUNTIMEABORT(msg);
     }
 
     return mDefaultFont.get();
 }
 
 gfxFont*
 gfxFontGroup::GetFirstValidFont(uint32_t aCh)
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -1090,17 +1090,17 @@ gfxWindowsPlatform::GetDLLVersion(char16
     DWORD fileVersLS = fileInfo->dwFileVersionLS;
 
     vers[0] = HIWORD(fileVersMS);
     vers[1] = LOWORD(fileVersMS);
     vers[2] = HIWORD(fileVersLS);
     vers[3] = LOWORD(fileVersLS);
 
     char buf[256];
-    snprintf_literal(buf, "%u.%u.%u.%u", vers[0], vers[1], vers[2], vers[3]);
+    SprintfLiteral(buf, "%u.%u.%u.%u", vers[0], vers[1], vers[2], vers[3]);
     aVersion.Assign(NS_ConvertUTF8toUTF16(buf));
 }
 
 void 
 gfxWindowsPlatform::GetCleartypeParams(nsTArray<ClearTypeParameterInfo>& aParams)
 {
     HKEY  hKey, subKey;
     DWORD i, rv, size, type;
--- a/image/decoders/icon/nsIconURI.cpp
+++ b/image/decoders/icon/nsIconURI.cpp
@@ -89,17 +89,17 @@ nsMozIconURI::GetSpec(nsACString& aSpec)
     aSpec += mFileName;
   }
 
   aSpec += "?size=";
   if (mIconSize >= 0) {
     aSpec += kSizeStrings[mIconSize];
   } else {
     char buf[20];
-    snprintf_literal(buf, "%d", mSize);
+    SprintfLiteral(buf, "%d", mSize);
     aSpec.Append(buf);
   }
 
   if (mIconState >= 0) {
     aSpec += "&state=";
     aSpec += kStateStrings[mIconState];
   }
 
--- a/intl/locale/nsScriptableDateFormat.cpp
+++ b/intl/locale/nsScriptableDateFormat.cpp
@@ -109,17 +109,17 @@ NS_IMETHODIMP nsScriptableDateFormat::Fo
   if ((time_t)-1 != timetTime) {
     rv = dateTimeFormat->FormatTime(locale, dateFormatSelector, timeFormatSelector, 
                                      timetTime, mStringOut);
   }
   else {
     // if mktime fails (e.g. year <= 1970), then try NSPR.
     PRTime prtime;
     char string[32];
-    snprintf_literal(string, "%.2d/%.2d/%d %.2d:%.2d:%.2d", month, day, year, hour, minute, second);
+    SprintfLiteral(string, "%.2d/%.2d/%d %.2d:%.2d:%.2d", month, day, year, hour, minute, second);
     if (PR_SUCCESS != PR_ParseTimeString(string, false, &prtime))
       return NS_ERROR_INVALID_ARG;
 
     rv = dateTimeFormat->FormatPRTime(locale, dateFormatSelector, timeFormatSelector, 
                                       prtime, mStringOut);
   }
   if (NS_SUCCEEDED(rv))
     *dateTimeString = ToNewUnicode(mStringOut);
--- a/intl/locale/unix/nsPosixLocale.cpp
+++ b/intl/locale/unix/nsPosixLocale.cpp
@@ -26,28 +26,28 @@ nsPosixLocale::GetPlatformLocale(const n
     if (!ParseLocaleString(xp_locale.get(),lang_code,country_code,extra,'-')) {
 //      strncpy(posixLocale,"C",length);
       posixLocale = xp_locale;  // use xp locale if parse failed
       return NS_OK;
     }
 
     if (*country_code) {
       if (*extra) {
-        snprintf_literal(posix_locale,"%s_%s.%s",lang_code,country_code,extra);
+        SprintfLiteral(posix_locale,"%s_%s.%s",lang_code,country_code,extra);
       }
       else {
-        snprintf_literal(posix_locale,"%s_%s",lang_code,country_code);
+        SprintfLiteral(posix_locale,"%s_%s",lang_code,country_code);
       }
     }
     else {
       if (*extra) {
-        snprintf_literal(posix_locale,"%s.%s",lang_code,extra);
+        SprintfLiteral(posix_locale,"%s.%s",lang_code,extra);
       }
       else {
-        snprintf_literal(posix_locale,"%s",lang_code);
+        SprintfLiteral(posix_locale,"%s",lang_code);
       }
     }
 
     posixLocale = posix_locale;
     return NS_OK;
   }
 
   return NS_ERROR_FAILURE;
@@ -79,20 +79,20 @@ nsPosixLocale::GetXPLocale(const char* p
 
     // Special case: substitute "nb" (Norwegian Bokmal) for macrolanguage
     // code "no" (Norwegian)
     if (nsDependentCString(lang_code).LowerCaseEqualsLiteral("no")) {
       lang_code[1] = 'b';
     }
 
     if (*country_code) {
-      snprintf_literal(posix_locale,"%s-%s",lang_code,country_code);
+      SprintfLiteral(posix_locale,"%s-%s",lang_code,country_code);
     } 
     else {
-      snprintf_literal(posix_locale,"%s",lang_code);
+      SprintfLiteral(posix_locale,"%s",lang_code);
     }
 
     CopyASCIItoUTF16(nsDependentCString(posix_locale), locale);
     return NS_OK;
 
   }
 
     return NS_ERROR_FAILURE;
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -706,17 +706,17 @@ GeckoChildProcessHost::PerformAsyncLaunc
     return false;
   }
 
   base::ProcessHandle process = 0;
 
   // send the child the PID so that it can open a ProcessHandle back to us.
   // probably don't want to do this in the long run
   char pidstring[32];
-  snprintf_literal(pidstring,"%d", base::Process::Current().pid());
+  SprintfLiteral(pidstring,"%d", base::Process::Current().pid());
 
   const char* const childProcessType =
       XRE_ChildProcessTypeToString(mProcessType);
 
 //--------------------------------------------------
 #if defined(OS_POSIX)
   // For POSIX, we have to be extremely anal about *not* using
   // std::wstring in code compiled with Mozilla's -fshort-wchar
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -1977,18 +1977,18 @@ MessageChannel::ReportConnectionError(co
         break;
 
       default:
         NS_RUNTIMEABORT("unreached");
     }
 
     if (aMsg) {
         char reason[512];
-        snprintf_literal(reason,"(msgtype=0x%X,name=%s) %s",
-                         aMsg->type(), aMsg->name(), errorMsg);
+        SprintfLiteral(reason,"(msgtype=0x%X,name=%s) %s",
+                       aMsg->type(), aMsg->name(), errorMsg);
 
         PrintErrorMessage(mSide, aChannelName, reason);
     } else {
         PrintErrorMessage(mSide, aChannelName, errorMsg);
     }
 
     MonitorAutoUnlock unlock(*mMonitor);
     mListener->OnProcessingError(MsgDropped, errorMsg);
@@ -2022,18 +2022,18 @@ MessageChannel::MaybeHandleError(Result 
         break;
 
     default:
         NS_RUNTIMEABORT("unknown Result code");
         return false;
     }
 
     char reason[512];
-    snprintf_literal(reason,"(msgtype=0x%X,name=%s) %s",
-                     aMsg.type(), aMsg.name(), errorMsg);
+    SprintfLiteral(reason,"(msgtype=0x%X,name=%s) %s",
+                   aMsg.type(), aMsg.name(), errorMsg);
 
     PrintErrorMessage(mSide, channelName, reason);
 
     mListener->OnProcessingError(code, reason);
 
     return false;
 }
 
--- a/ipc/netd/Netd.cpp
+++ b/ipc/netd/Netd.cpp
@@ -65,19 +65,19 @@ InitRndisAddress()
   memset(address, 0, sizeof(address));
   // First byte is 0x02 to signify a locally administered address.
   address[0] = 0x02;
   length = strlen(serialno);
   for (i = 0; i < length; i++) {
     address[i % (kEthernetAddressLength - 1) + 1] ^= serialno[i];
   }
 
-  snprintf_literal(mac, "%02x:%02x:%02x:%02x:%02x:%02x",
-                   address[0], address[1], address[2],
-                   address[3], address[4], address[5]);
+  SprintfLiteral(mac, "%02x:%02x:%02x:%02x:%02x:%02x",
+                 address[0], address[1], address[2],
+                 address[3], address[4], address[5]);
   length = strlen(mac);
   ret = write(fd.get(), mac, length);
   if (ret != length) {
     NETD_LOG("Fail to write file %s.", ICS_SYS_USB_RNDIS_MAC);
     return false;
   }
   return true;
 }
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -314,18 +314,18 @@ GC(JSContext* cx, unsigned argc, Value* 
     else
         JS::PrepareForFullGC(cx);
 
     JSGCInvocationKind gckind = shrinking ? GC_SHRINK : GC_NORMAL;
     JS::GCForReason(cx, gckind, JS::gcreason::API);
 
     char buf[256] = { '\0' };
 #ifndef JS_MORE_DETERMINISTIC
-    snprintf_literal(buf, "before %" PRIuSIZE ", after %" PRIuSIZE "\n",
-                     preBytes, cx->runtime()->gc.usage.gcBytes());
+    SprintfLiteral(buf, "before %" PRIuSIZE ", after %" PRIuSIZE "\n",
+                   preBytes, cx->runtime()->gc.usage.gcBytes());
 #endif
     JSString* str = JS_NewStringCopyZ(cx, buf);
     if (!str)
         return false;
     args.rval().setString(str);
     return true;
 }
 
@@ -2397,17 +2397,17 @@ ObjectAddress(JSContext* cx, unsigned ar
         return false;
     }
 
 #ifdef JS_MORE_DETERMINISTIC
     args.rval().setInt32(0);
 #else
     void* ptr = js::UncheckedUnwrap(&args[0].toObject(), true);
     char buffer[64];
-    snprintf_literal(buffer, "%p", ptr);
+    SprintfLiteral(buffer, "%p", ptr);
 
     JSString* str = JS_NewStringCopyZ(cx, buffer);
     if (!str)
         return false;
 
     args.rval().setString(str);
 #endif
 
@@ -2438,18 +2438,18 @@ SharedAddress(JSContext* cx, unsigned ar
         return false;
     }
     if (!obj->is<SharedArrayBufferObject>()) {
         JS_ReportError(cx, "Argument must be a SharedArrayBuffer");
         return false;
     }
     char buffer[64];
     uint32_t nchar =
-        snprintf_literal(buffer, "%p",
-                         obj->as<SharedArrayBufferObject>().dataPointerShared().unwrap(/*safeish*/));
+        SprintfLiteral(buffer, "%p",
+                       obj->as<SharedArrayBufferObject>().dataPointerShared().unwrap(/*safeish*/));
 
     JSString* str = JS_NewStringCopyN(cx, buffer, nchar);
     if (!str)
         return false;
 
     args.rval().setString(str);
 #endif
 
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -91,17 +91,17 @@ GetDeflatedUTF8StringLength(JSContext* m
         }
     }
     return nbytes;
 
   bad_surrogate:
     if (maybecx) {
         js::gc::AutoSuppressGC suppress(maybecx);
         char buffer[10];
-        snprintf_literal(buffer, "0x%x", c);
+        SprintfLiteral(buffer, "0x%x", c);
         JS_ReportErrorFlagsAndNumber(maybecx, JSREPORT_ERROR, GetErrorMessage,
                                      nullptr, JSMSG_BAD_SURROGATE_CHAR, buffer);
     }
     return (size_t) -1;
 }
 
 template size_t
 GetDeflatedUTF8StringLength(JSContext* maybecx, const Latin1Char* chars,
@@ -1117,17 +1117,17 @@ ConvError(JSContext* cx, const char* exp
   if (arrObj) {
     MOZ_ASSERT(CType::IsCType(arrObj));
 
     switch (CType::GetTypeCode(arrObj)) {
     case TYPE_array: {
       MOZ_ASSERT(!funObj);
 
       char indexStr[16];
-      snprintf_literal(indexStr, "%u", arrIndex);
+      SprintfLiteral(indexStr, "%u", arrIndex);
 
       AutoString arrSource;
       JSAutoByteString arrBytes;
       BuildTypeSource(cx, arrObj, true, arrSource);
       const char* arrStr = EncodeLatin1(cx, arrSource, arrBytes);
       if (!arrStr)
         return false;
 
@@ -1174,17 +1174,17 @@ ConvError(JSContext* cx, const char* exp
     return false;
   }
 
   switch (convType) {
   case ConversionType::Argument: {
     MOZ_ASSERT(funObj);
 
     char indexStr[16];
-    snprintf_literal(indexStr, "%u", argIndex + 1);
+    SprintfLiteral(indexStr, "%u", argIndex + 1);
 
     AutoString funSource;
     JSAutoByteString funBytes;
     BuildFunctionTypeSource(cx, funObj, funSource);
     const char* funStr = EncodeLatin1(cx, funSource, funBytes);
     if (!funStr)
       return false;
 
@@ -1257,17 +1257,17 @@ ArgumentConvError(JSContext* cx, HandleV
                   unsigned argIndex)
 {
   JSAutoByteString valBytes;
   const char* valStr = CTypesToSourceForError(cx, actual, valBytes);
   if (!valStr)
     return false;
 
   char indexStr[16];
-  snprintf_literal(indexStr, "%u", argIndex + 1);
+  SprintfLiteral(indexStr, "%u", argIndex + 1);
 
   JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                        CTYPESMSG_CONV_ERROR_ARG, valStr, indexStr, funStr);
   return false;
 }
 
 static bool
 ArgumentLengthError(JSContext* cx, const char* fun, const char* count,
@@ -1286,19 +1286,19 @@ ArrayLengthMismatch(JSContext* cx, unsig
   MOZ_ASSERT(arrObj && CType::IsCType(arrObj));
 
   JSAutoByteString valBytes;
   const char* valStr = CTypesToSourceForError(cx, actual, valBytes);
   if (!valStr)
     return false;
 
   char expectedLengthStr[16];
-  snprintf_literal(expectedLengthStr, "%u", expectedLength);
+  SprintfLiteral(expectedLengthStr, "%u", expectedLength);
   char actualLengthStr[16];
-  snprintf_literal(actualLengthStr, "%u", actualLength);
+  SprintfLiteral(actualLengthStr, "%u", actualLength);
 
   AutoString arrSource;
   JSAutoByteString arrBytes;
   BuildTypeSource(cx, arrObj, true, arrSource);
   const char* arrStr = EncodeLatin1(cx, arrSource, arrBytes);
   if (!arrStr)
     return false;
 
@@ -1316,19 +1316,19 @@ ArrayLengthOverflow(JSContext* cx, unsig
   MOZ_ASSERT(arrObj && CType::IsCType(arrObj));
 
   JSAutoByteString valBytes;
   const char* valStr = CTypesToSourceForError(cx, actual, valBytes);
   if (!valStr)
     return false;
 
   char expectedLengthStr[16];
-  snprintf_literal(expectedLengthStr, "%u", expectedLength);
+  SprintfLiteral(expectedLengthStr, "%u", expectedLength);
   char actualLengthStr[16];
-  snprintf_literal(actualLengthStr, "%u", actualLength);
+  SprintfLiteral(actualLengthStr, "%u", actualLength);
 
   AutoString arrSource;
   JSAutoByteString arrBytes;
   BuildTypeSource(cx, arrObj, true, arrSource);
   const char* arrStr = EncodeLatin1(cx, arrSource, arrBytes);
   if (!arrStr)
     return false;
 
@@ -1423,19 +1423,19 @@ FieldCountMismatch(JSContext* cx,
   AutoString structSource;
   JSAutoByteString structBytes;
   BuildTypeSource(cx, structObj, true, structSource);
   const char* structStr = EncodeLatin1(cx, structSource, structBytes);
   if (!structStr)
     return false;
 
   char expectedCountStr[16];
-  snprintf_literal(expectedCountStr, "%u", expectedCount);
+  SprintfLiteral(expectedCountStr, "%u", expectedCount);
   char actualCountStr[16];
-  snprintf_literal(actualCountStr, "%u", actualCount);
+  SprintfLiteral(actualCountStr, "%u", actualCount);
 
   JSAutoByteString posBytes;
   const char* posStr;
   if (funObj) {
     AutoString posSource;
     BuildConversionPosition(cx, convType, funObj, argIndex, posSource);
     posStr = EncodeLatin1(cx, posSource, posBytes);
     if (!posStr)
@@ -1456,17 +1456,17 @@ FieldDescriptorCountError(JSContext* cx,
 {
   RootedValue typeVal(cx, val);
   JSAutoByteString valBytes;
   const char* valStr = CTypesToSourceForError(cx, typeVal, valBytes);
   if (!valStr)
     return false;
 
   char lengthStr[16];
-  snprintf_literal(lengthStr, "%" PRIuSIZE, length);
+  SprintfLiteral(lengthStr, "%" PRIuSIZE, length);
 
   JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                        CTYPESMSG_FIELD_DESC_COUNT, valStr, lengthStr);
   return false;
 }
 
 static bool
 FieldDescriptorNameError(JSContext* cx, HandleId id)
@@ -1591,19 +1591,19 @@ FunctionArgumentLengthMismatch(JSContext
   } else {
     BuildFunctionTypeSource(cx, typeObj, funSource);
   }
   const char* funStr = EncodeLatin1(cx, funSource, funBytes);
   if (!funStr)
     return false;
 
   char expectedCountStr[16];
-  snprintf_literal(expectedCountStr, "%u", expectedCount);
+  SprintfLiteral(expectedCountStr, "%u", expectedCount);
   char actualCountStr[16];
-  snprintf_literal(actualCountStr, "%u", actualCount);
+  SprintfLiteral(actualCountStr, "%u", actualCount);
 
   const char* variadicStr = isVariadic ? " or more": "";
 
   JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                        CTYPESMSG_ARG_COUNT_MISMATCH,
                        funStr, expectedCountStr, variadicStr, actualCountStr);
   return false;
 }
@@ -1614,17 +1614,17 @@ FunctionArgumentTypeError(JSContext* cx,
 {
   RootedValue val(cx, type);
   JSAutoByteString valBytes;
   const char* valStr = CTypesToSourceForError(cx, val, valBytes);
   if (!valStr)
     return false;
 
   char indexStr[16];
-  snprintf_literal(indexStr, "%u", index + 1);
+  SprintfLiteral(indexStr, "%u", index + 1);
 
   JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                        CTYPESMSG_ARG_TYPE_ERROR, indexStr, reason, valStr);
   return false;
 }
 
 static bool
 FunctionReturnTypeError(JSContext* cx, Value type, const char* reason)
@@ -1720,20 +1720,20 @@ InvalidIndexError(JSContext* cx, HandleI
   RootedValue idVal(cx, IdToValue(id));
   return InvalidIndexError(cx, idVal);
 }
 
 static bool
 InvalidIndexRangeError(JSContext* cx, size_t index, size_t length)
 {
   char indexStr[16];
-  snprintf_literal(indexStr, "%" PRIuSIZE, index);
+  SprintfLiteral(indexStr, "%" PRIuSIZE, index);
 
   char lengthStr[16];
-  snprintf_literal(lengthStr,"%" PRIuSIZE, length);
+  SprintfLiteral(lengthStr,"%" PRIuSIZE, length);
 
   JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                        CTYPESMSG_INVALID_RANGE, indexStr, lengthStr);
   return false;
 }
 
 static bool
 NonPrimitiveError(JSContext* cx, HandleObject typeObj)
@@ -1880,18 +1880,18 @@ SizeMismatchCastError(JSContext* cx,
   BuildTypeSource(cx, targetTypeObj, true, targetTypeSource);
   const char* targetTypeStr = EncodeLatin1(cx, targetTypeSource,
                                            targetTypeBytes);
   if (!targetTypeStr)
     return false;
 
   char sourceSizeStr[16];
   char targetSizeStr[16];
-  snprintf_literal(sourceSizeStr, "%" PRIuSIZE, sourceSize);
-  snprintf_literal(targetSizeStr, "%" PRIuSIZE, targetSize);
+  SprintfLiteral(sourceSizeStr, "%" PRIuSIZE, sourceSize);
+  SprintfLiteral(targetSizeStr, "%" PRIuSIZE, targetSize);
 
   JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                        CTYPESMSG_SIZE_MISMATCH_CAST,
                        targetTypeStr, sourceTypeStr,
                        targetSizeStr, sourceSizeStr);
   return false;
 }
 
@@ -1913,17 +1913,17 @@ static bool
 VariadicArgumentTypeError(JSContext* cx, uint32_t index, HandleValue actual)
 {
   JSAutoByteString valBytes;
   const char* valStr = CTypesToSourceForError(cx, actual, valBytes);
   if (!valStr)
     return false;
 
   char indexStr[16];
-  snprintf_literal(indexStr, "%u", index + 1);
+  SprintfLiteral(indexStr, "%u", index + 1);
 
   JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                        CTYPESMSG_VARG_TYPE_ERROR, indexStr, valStr);
   return false;
 }
 
 static JSObject*
 InitCTypeClass(JSContext* cx, HandleObject ctypesObj)
@@ -6302,17 +6302,17 @@ StructType::ConstructData(JSContext* cx,
     }
 
     return true;
   }
 
   size_t count = fields->count();
   if (count >= 2) {
     char fieldLengthStr[32];
-    snprintf_literal(fieldLengthStr, "0, 1, or %" PRIuSIZE, count);
+    SprintfLiteral(fieldLengthStr, "0, 1, or %" PRIuSIZE, count);
     return ArgumentLengthError(cx, "StructType constructor", fieldLengthStr,
                                "s");
   }
   return ArgumentLengthError(cx, "StructType constructor", "at most one", "");
 }
 
 const FieldInfoHash*
 StructType::GetFieldInfo(JSObject* obj)
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -336,21 +336,21 @@ Statistics::formatCompactSliceMessage() 
     const SliceData& slice = slices[index];
 
     char budgetDescription[200];
     slice.budget.describe(budgetDescription, sizeof(budgetDescription) - 1);
 
     const char* format =
         "GC Slice %u - Pause: %.3fms of %s budget (@ %.3fms); Reason: %s; Reset: %s%s; Times: ";
     char buffer[1024];
-    snprintf_literal(buffer, format, index,
-                     t(slice.duration()), budgetDescription, t(slice.start - slices[0].start),
-                     ExplainReason(slice.reason),
-                     slice.resetReason ? "yes - " : "no",
-                     slice.resetReason ? slice.resetReason : "");
+    SprintfLiteral(buffer, format, index,
+                   t(slice.duration()), budgetDescription, t(slice.start - slices[0].start),
+                   ExplainReason(slice.reason),
+                   slice.resetReason ? "yes - " : "no",
+                   slice.resetReason ? slice.resetReason : "");
 
     FragmentVector fragments;
     if (!fragments.append(DuplicateString(buffer)) ||
         !fragments.append(formatCompactSlicePhaseTimes(slices[index].phaseTimes)))
     {
         return UniqueChars(nullptr);
     }
     return Join(fragments);
@@ -368,44 +368,44 @@ Statistics::formatCompactSummaryMessage(
     int64_t total, longest;
     gcDuration(&total, &longest);
 
     const double mmu20 = computeMMU(20 * PRMJ_USEC_PER_MSEC);
     const double mmu50 = computeMMU(50 * PRMJ_USEC_PER_MSEC);
 
     char buffer[1024];
     if (!nonincrementalReason_) {
-        snprintf_literal(buffer,
-                         "Max Pause: %.3fms; MMU 20ms: %.1f%%; MMU 50ms: %.1f%%; Total: %.3fms; ",
-                         t(longest), mmu20 * 100., mmu50 * 100., t(total));
+        SprintfLiteral(buffer,
+                       "Max Pause: %.3fms; MMU 20ms: %.1f%%; MMU 50ms: %.1f%%; Total: %.3fms; ",
+                       t(longest), mmu20 * 100., mmu50 * 100., t(total));
     } else {
-        snprintf_literal(buffer, "Non-Incremental: %.3fms (%s); ",
-                         t(total), nonincrementalReason_);
+        SprintfLiteral(buffer, "Non-Incremental: %.3fms (%s); ",
+                       t(total), nonincrementalReason_);
     }
     if (!fragments.append(DuplicateString(buffer)))
         return UniqueChars(nullptr);
 
-    snprintf_literal(buffer,
-                     "Zones: %d of %d (-%d); Compartments: %d of %d (-%d); HeapSize: %.3f MiB; "\
-                     "HeapChange (abs): %+d (%d); ",
-                     zoneStats.collectedZoneCount, zoneStats.zoneCount, zoneStats.sweptZoneCount,
-                     zoneStats.collectedCompartmentCount, zoneStats.compartmentCount,
-                     zoneStats.sweptCompartmentCount,
-                     double(preBytes) / bytesPerMiB,
-                     counts[STAT_NEW_CHUNK] - counts[STAT_DESTROY_CHUNK],
-                     counts[STAT_NEW_CHUNK] + counts[STAT_DESTROY_CHUNK]);
+    SprintfLiteral(buffer,
+                   "Zones: %d of %d (-%d); Compartments: %d of %d (-%d); HeapSize: %.3f MiB; " \
+                   "HeapChange (abs): %+d (%d); ",
+                   zoneStats.collectedZoneCount, zoneStats.zoneCount, zoneStats.sweptZoneCount,
+                   zoneStats.collectedCompartmentCount, zoneStats.compartmentCount,
+                   zoneStats.sweptCompartmentCount,
+                   double(preBytes) / bytesPerMiB,
+                   counts[STAT_NEW_CHUNK] - counts[STAT_DESTROY_CHUNK],
+                   counts[STAT_NEW_CHUNK] + counts[STAT_DESTROY_CHUNK]);
     if (!fragments.append(DuplicateString(buffer)))
         return UniqueChars(nullptr);
 
     MOZ_ASSERT_IF(counts[STAT_ARENA_RELOCATED], gckind == GC_SHRINK);
     if (gckind == GC_SHRINK) {
-        snprintf_literal(buffer,
-                         "Kind: %s; Relocated: %.3f MiB; ",
-                         ExplainInvocationKind(gckind),
-                         double(ArenaSize * counts[STAT_ARENA_RELOCATED]) / bytesPerMiB);
+        SprintfLiteral(buffer,
+                       "Kind: %s; Relocated: %.3f MiB; ",
+                       ExplainInvocationKind(gckind),
+                       double(ArenaSize * counts[STAT_ARENA_RELOCATED]) / bytesPerMiB);
         if (!fragments.append(DuplicateString(buffer)))
             return UniqueChars(nullptr);
     }
 
     return Join(fragments);
 }
 
 UniqueChars
@@ -420,23 +420,23 @@ Statistics::formatCompactSlicePhaseTimes
         size_t dagSlot;
         size_t level;
         iter.get(&phase, &dagSlot, &level);
         MOZ_ASSERT(level < 4);
 
         int64_t ownTime = phaseTimes[dagSlot][phase];
         int64_t childTime = SumChildTimes(dagSlot, phase, phaseTimes);
         if (ownTime > MaxUnaccountedTimeUS) {
-            snprintf_literal(buffer, "%s: %.3fms", phases[phase].name, t(ownTime));
+            SprintfLiteral(buffer, "%s: %.3fms", phases[phase].name, t(ownTime));
             if (!fragments.append(DuplicateString(buffer)))
                 return UniqueChars(nullptr);
 
             if (childTime && (ownTime - childTime) > MaxUnaccountedTimeUS) {
                 MOZ_ASSERT(level < 3);
-                snprintf_literal(buffer, "%s: %.3fms", "Other", t(ownTime - childTime));
+                SprintfLiteral(buffer, "%s: %.3fms", "Other", t(ownTime - childTime));
                 if (!fragments.append(DuplicateString(buffer)))
                     return UniqueChars(nullptr);
             }
         }
     }
     return Join(fragments, ", ");
 }
 
@@ -486,32 +486,32 @@ Statistics::formatDetailedDescription()
   Store Buffer Overflows: %d\n\
   MMU 20ms:%.1f%%; 50ms:%.1f%%\n\
   SCC Sweep Total (MaxPause): %.3fms (%.3fms)\n\
   HeapSize: %.3f MiB\n\
   Chunk Delta (magnitude): %+d  (%d)\n\
   Arenas Relocated: %.3f MiB\n\
 ";
     char buffer[1024];
-    snprintf_literal(buffer, format,
-                     ExplainInvocationKind(gckind),
-                     ExplainReason(slices[0].reason),
-                     nonincrementalReason_ ? "no - " : "yes",
-                     nonincrementalReason_ ? nonincrementalReason_ : "",
-                     zoneStats.collectedZoneCount, zoneStats.zoneCount, zoneStats.sweptZoneCount,
-                     zoneStats.collectedCompartmentCount, zoneStats.compartmentCount,
-                        zoneStats.sweptCompartmentCount,
-                     counts[STAT_MINOR_GC],
-                     counts[STAT_STOREBUFFER_OVERFLOW],
-                     mmu20 * 100., mmu50 * 100.,
-                     t(sccTotal), t(sccLongest),
-                     double(preBytes) / bytesPerMiB,
-                     counts[STAT_NEW_CHUNK] - counts[STAT_DESTROY_CHUNK], counts[STAT_NEW_CHUNK] +
-                        counts[STAT_DESTROY_CHUNK],
-                     double(ArenaSize * counts[STAT_ARENA_RELOCATED]) / bytesPerMiB);
+    SprintfLiteral(buffer, format,
+                   ExplainInvocationKind(gckind),
+                   ExplainReason(slices[0].reason),
+                   nonincrementalReason_ ? "no - " : "yes",
+                   nonincrementalReason_ ? nonincrementalReason_ : "",
+                   zoneStats.collectedZoneCount, zoneStats.zoneCount, zoneStats.sweptZoneCount,
+                   zoneStats.collectedCompartmentCount, zoneStats.compartmentCount,
+                   zoneStats.sweptCompartmentCount,
+                   counts[STAT_MINOR_GC],
+                   counts[STAT_STOREBUFFER_OVERFLOW],
+                   mmu20 * 100., mmu50 * 100.,
+                   t(sccTotal), t(sccLongest),
+                   double(preBytes) / bytesPerMiB,
+                   counts[STAT_NEW_CHUNK] - counts[STAT_DESTROY_CHUNK],
+                   counts[STAT_NEW_CHUNK] + counts[STAT_DESTROY_CHUNK],
+                   double(ArenaSize * counts[STAT_ARENA_RELOCATED]) / bytesPerMiB);
     return DuplicateString(buffer);
 }
 
 UniqueChars
 Statistics::formatDetailedSliceDescription(unsigned i, const SliceData& slice)
 {
     char budgetDescription[200];
     slice.budget.describe(budgetDescription, sizeof(budgetDescription) - 1);
@@ -521,22 +521,22 @@ Statistics::formatDetailedSliceDescripti
   ---- Slice %u ----\n\
     Reason: %s\n\
     Reset: %s%s\n\
     State: %s -> %s\n\
     Page Faults: %ld\n\
     Pause: %.3fms of %s budget (@ %.3fms)\n\
 ";
     char buffer[1024];
-    snprintf_literal(buffer, format, i, ExplainReason(slice.reason),
-                     slice.resetReason ? "yes - " : "no",
-                     slice.resetReason ? slice.resetReason : "",
-                     gc::StateName(slice.initialState), gc::StateName(slice.finalState),
-                     uint64_t(slice.endFaults - slice.startFaults),
-                     t(slice.duration()), budgetDescription, t(slice.start - slices[0].start));
+    SprintfLiteral(buffer, format, i, ExplainReason(slice.reason),
+                   slice.resetReason ? "yes - " : "no",
+                   slice.resetReason ? slice.resetReason : "",
+                   gc::StateName(slice.initialState), gc::StateName(slice.finalState),
+                   uint64_t(slice.endFaults - slice.startFaults),
+                   t(slice.duration()), budgetDescription, t(slice.start - slices[0].start));
     return DuplicateString(buffer);
 }
 
 UniqueChars
 Statistics::formatDetailedPhaseTimes(const PhaseTimeTable phaseTimes)
 {
     static const char* LevelToIndent[] = { "", "  ", "    ", "      " };
     static const int64_t MaxUnaccountedChildTimeUS = 50;
@@ -548,25 +548,25 @@ Statistics::formatDetailedPhaseTimes(con
         size_t dagSlot;
         size_t level;
         iter.get(&phase, &dagSlot, &level);
         MOZ_ASSERT(level < 4);
 
         int64_t ownTime = phaseTimes[dagSlot][phase];
         int64_t childTime = SumChildTimes(dagSlot, phase, phaseTimes);
         if (ownTime > 0) {
-            snprintf_literal(buffer, "      %s%s: %.3fms\n",
-                             LevelToIndent[level], phases[phase].name, t(ownTime));
+            SprintfLiteral(buffer, "      %s%s: %.3fms\n",
+                           LevelToIndent[level], phases[phase].name, t(ownTime));
             if (!fragments.append(DuplicateString(buffer)))
                 return UniqueChars(nullptr);
 
             if (childTime && (ownTime - childTime) > MaxUnaccountedChildTimeUS) {
                 MOZ_ASSERT(level < 3);
-                snprintf_literal(buffer, "      %s%s: %.3fms\n",
-                                 LevelToIndent[level + 1], "Other", t(ownTime - childTime));
+                SprintfLiteral(buffer, "      %s%s: %.3fms\n",
+                               LevelToIndent[level + 1], "Other", t(ownTime - childTime));
                 if (!fragments.append(DuplicateString(buffer)))
                     return UniqueChars(nullptr);
             }
         }
     }
     return Join(fragments);
 }
 
@@ -578,17 +578,17 @@ Statistics::formatDetailedTotals()
 
     const char* format =
 "\
   ---- Totals ----\n\
     Total Time: %.3fms\n\
     Max Pause: %.3fms\n\
 ";
     char buffer[1024];
-    snprintf_literal(buffer, format, t(total), t(longest));
+    SprintfLiteral(buffer, format, t(total), t(longest));
     return DuplicateString(buffer);
 }
 
 UniqueChars
 Statistics::formatJsonMessage(uint64_t timestamp)
 {
     MOZ_ASSERT(!aborted);
 
@@ -648,33 +648,33 @@ Statistics::formatJsonDescription(uint64
         "\"mmu_50ms\":%d,"
         "\"scc_sweep_total\":%llu.%03llu,"
         "\"scc_sweep_max_pause\":%llu.%03llu,"
         "\"nonincremental_reason\":\"%s\","
         "\"allocated\":%u,"
         "\"added_chunks\":%d,"
         "\"removed_chunks\":%d,";
     char buffer[1024];
-    snprintf_literal(buffer, format,
-                     (unsigned long long)timestamp,
-                     longest / 1000, longest % 1000,
-                     total / 1000, total % 1000,
-                     zoneStats.collectedZoneCount,
-                     zoneStats.zoneCount,
-                     zoneStats.compartmentCount,
-                     counts[STAT_MINOR_GC],
-                     counts[STAT_STOREBUFFER_OVERFLOW],
-                     int(mmu20 * 100),
-                     int(mmu50 * 100),
-                     sccTotal / 1000, sccTotal % 1000,
-                     sccLongest / 1000, sccLongest % 1000,
-                     nonincrementalReason_ ? nonincrementalReason_ : "none",
-                     unsigned(preBytes / 1024 / 1024),
-                     counts[STAT_NEW_CHUNK],
-                     counts[STAT_DESTROY_CHUNK]);
+    SprintfLiteral(buffer, format,
+                   (unsigned long long)timestamp,
+                   longest / 1000, longest % 1000,
+                   total / 1000, total % 1000,
+                   zoneStats.collectedZoneCount,
+                   zoneStats.zoneCount,
+                   zoneStats.compartmentCount,
+                   counts[STAT_MINOR_GC],
+                   counts[STAT_STOREBUFFER_OVERFLOW],
+                   int(mmu20 * 100),
+                   int(mmu50 * 100),
+                   sccTotal / 1000, sccTotal % 1000,
+                   sccLongest / 1000, sccLongest % 1000,
+                   nonincrementalReason_ ? nonincrementalReason_ : "none",
+                   unsigned(preBytes / 1024 / 1024),
+                   counts[STAT_NEW_CHUNK],
+                   counts[STAT_DESTROY_CHUNK]);
     return DuplicateString(buffer);
 }
 
 UniqueChars
 Statistics::formatJsonSliceDescription(unsigned i, const SliceData& slice)
 {
     int64_t duration = slice.duration();
     int64_t when = slice.start - slices[0].start;
@@ -689,27 +689,27 @@ Statistics::formatJsonSliceDescription(u
         "\"reason\":\"%s\","
         "\"initial_state\":\"%s\","
         "\"final_state\":\"%s\","
         "\"budget\":\"%s\","
         "\"page_faults\":%llu,"
         "\"start_timestamp\":%llu,"
         "\"end_timestamp\":%llu,";
     char buffer[1024];
-    snprintf_literal(buffer, format,
-                     i,
-                     duration / 1000, duration % 1000,
-                     when / 1000, when % 1000,
-                     ExplainReason(slice.reason),
-                     gc::StateName(slice.initialState),
-                     gc::StateName(slice.finalState),
-                     budgetDescription,
-                     pageFaults,
-                     slice.start,
-                     slice.end);
+    SprintfLiteral(buffer, format,
+                   i,
+                   duration / 1000, duration % 1000,
+                   when / 1000, when % 1000,
+                   ExplainReason(slice.reason),
+                   gc::StateName(slice.initialState),
+                   gc::StateName(slice.finalState),
+                   budgetDescription,
+                   pageFaults,
+                   slice.start,
+                   slice.end);
     return DuplicateString(buffer);
 }
 
 UniqueChars
 FilterJsonKey(const char*const buffer)
 {
     char* mut = strdup(buffer);
     char* c = mut;
@@ -730,18 +730,18 @@ Statistics::formatJsonPhaseTimes(const P
     char buffer[128];
     for (AllPhaseIterator iter(phaseTimes); !iter.done(); iter.advance()) {
         Phase phase;
         size_t dagSlot;
         iter.get(&phase, &dagSlot);
 
         UniqueChars name = FilterJsonKey(phases[phase].name);
         int64_t ownTime = phaseTimes[dagSlot][phase];
-        snprintf_literal(buffer, "\"%s\":%" PRId64 ".%03" PRId64,
-                         name.get(), ownTime / 1000, ownTime % 1000);
+        SprintfLiteral(buffer, "\"%s\":%" PRId64 ".%03" PRId64,
+                       name.get(), ownTime / 1000, ownTime % 1000);
 
         if (!fragments.append(DuplicateString(buffer)))
             return UniqueChars(nullptr);
     }
     return Join(fragments, ",");
 }
 
 Statistics::Statistics(JSRuntime* rt)
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -2463,17 +2463,17 @@ print_iso_extended_string(char* buf, siz
 /* ES5 B.2.6. */
 MOZ_ALWAYS_INLINE bool
 date_toGMTString_impl(JSContext* cx, const CallArgs& args)
 {
     double utctime = args.thisv().toObject().as<DateObject>().UTCTime().toNumber();
 
     char buf[100];
     if (!IsFinite(utctime))
-        snprintf_literal(buf, js_NaN_date_str);
+        SprintfLiteral(buf, js_NaN_date_str);
     else
         print_gmt_string(buf, sizeof buf, utctime);
 
     JSString* str = JS_NewStringCopyZ(cx, buf);
     if (!str)
         return false;
     args.rval().setString(str);
     return true;
@@ -2588,17 +2588,17 @@ date_format(JSContext* cx, double date, 
 {
     char buf[100];
     char tzbuf[100];
     bool usetz;
     size_t i, tzlen;
     PRMJTime split;
 
     if (!IsFinite(date)) {
-        snprintf_literal(buf, js_NaN_date_str);
+        SprintfLiteral(buf, js_NaN_date_str);
     } else {
         MOZ_ASSERT(NumbersAreIdentical(TimeClip(date).toDouble(), date));
 
         double local = LocalTime(date);
 
         /* offset from GMT in minutes.  The offset includes daylight savings,
            if it applies. */
         int minutes = (int) floor(AdjustTime(date) / msPerMinute);
@@ -2649,45 +2649,45 @@ date_format(JSContext* cx, double date, 
 
         switch (format) {
           case FORMATSPEC_FULL:
             /*
              * Avoid dependence on PRMJ_FormatTimeUSEnglish, because it
              * requires a PRMJTime... which only has 16-bit years.  Sub-ECMA.
              */
             /* Tue Oct 31 2000 09:41:40 GMT-0800 (PST) */
-            snprintf_literal(buf, "%s %s %.2d %.4d %.2d:%.2d:%.2d GMT%+.4d%s%s",
-                             days[int(WeekDay(local))],
-                             months[int(MonthFromTime(local))],
-                             int(DateFromTime(local)),
-                             int(YearFromTime(local)),
-                             int(HourFromTime(local)),
-                             int(MinFromTime(local)),
-                             int(SecFromTime(local)),
-                             offset,
-                             usetz ? " " : "",
-                             usetz ? tzbuf : "");
+            SprintfLiteral(buf, "%s %s %.2d %.4d %.2d:%.2d:%.2d GMT%+.4d%s%s",
+                           days[int(WeekDay(local))],
+                           months[int(MonthFromTime(local))],
+                           int(DateFromTime(local)),
+                           int(YearFromTime(local)),
+                           int(HourFromTime(local)),
+                           int(MinFromTime(local)),
+                           int(SecFromTime(local)),
+                           offset,
+                           usetz ? " " : "",
+                           usetz ? tzbuf : "");
             break;
           case FORMATSPEC_DATE:
             /* Tue Oct 31 2000 */
-            snprintf_literal(buf, "%s %s %.2d %.4d",
-                             days[int(WeekDay(local))],
-                             months[int(MonthFromTime(local))],
-                             int(DateFromTime(local)),
-                             int(YearFromTime(local)));
+            SprintfLiteral(buf, "%s %s %.2d %.4d",
+                           days[int(WeekDay(local))],
+                           months[int(MonthFromTime(local))],
+                           int(DateFromTime(local)),
+                           int(YearFromTime(local)));
             break;
           case FORMATSPEC_TIME:
             /* 09:41:40 GMT-0800 (PST) */
-            snprintf_literal(buf, "%.2d:%.2d:%.2d GMT%+.4d%s%s",
-                             int(HourFromTime(local)),
-                             int(MinFromTime(local)),
-                             int(SecFromTime(local)),
-                             offset,
-                             usetz ? " " : "",
-                             usetz ? tzbuf : "");
+            SprintfLiteral(buf, "%.2d:%.2d:%.2d GMT%+.4d%s%s",
+                           int(HourFromTime(local)),
+                           int(MinFromTime(local)),
+                           int(SecFromTime(local)),
+                           offset,
+                           usetz ? " " : "",
+                           usetz ? tzbuf : "");
             break;
         }
     }
 
     JSString* str = JS_NewStringCopyZ(cx, buf);
     if (!str)
         return false;
     rval.setString(str);
@@ -2696,17 +2696,17 @@ date_format(JSContext* cx, double date, 
 
 static bool
 ToLocaleFormatHelper(JSContext* cx, HandleObject obj, const char* format, MutableHandleValue rval)
 {
     double utctime = obj->as<DateObject>().UTCTime().toNumber();
 
     char buf[100];
     if (!IsFinite(utctime)) {
-        snprintf_literal(buf, js_NaN_date_str);
+        SprintfLiteral(buf, js_NaN_date_str);
     } else {
         int result_len;
         double local = LocalTime(utctime);
         PRMJTime split;
         new_explode(local, &split);
 
         /* Let PRMJTime format it. */
         result_len = PRMJ_FormatTime(buf, sizeof buf, format, &split);
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -838,18 +838,18 @@ ToDisassemblySource(JSContext* cx, Handl
 
 unsigned
 js::Disassemble1(JSContext* cx, HandleScript script, jsbytecode* pc,
                  unsigned loc, bool lines, Sprinter* sp)
 {
     JSOp op = (JSOp)*pc;
     if (op >= JSOP_LIMIT) {
         char numBuf1[12], numBuf2[12];
-        snprintf_literal(numBuf1, "%d", op);
-        snprintf_literal(numBuf2, "%d", JSOP_LIMIT);
+        SprintfLiteral(numBuf1, "%d", op);
+        SprintfLiteral(numBuf2, "%d", JSOP_LIMIT);
         JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                              JSMSG_BYTECODE_TOO_BIG, numBuf1, numBuf2);
         return 0;
     }
     const JSCodeSpec* cs = &CodeSpec[op];
     ptrdiff_t len = (ptrdiff_t) cs->length;
     if (Sprint(sp, "%05u:", loc) == -1)
         return 0;
@@ -1012,17 +1012,17 @@ js::Disassemble1(JSContext* cx, HandleSc
         i = GET_INT32(pc);
       print_int:
         if (Sprint(sp, " %d", i) == -1)
             return 0;
         break;
 
       default: {
         char numBuf[12];
-        snprintf_literal(numBuf, "%x", cs->format);
+        SprintfLiteral(numBuf, "%x", cs->format);
         JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                              JSMSG_UNKNOWN_FORMAT, numBuf);
         return 0;
       }
     }
     sp->put("\n");
     return len;
 }
--- a/js/src/jsprf.cpp
+++ b/js/src/jsprf.cpp
@@ -307,17 +307,17 @@ static bool cvt_f(SprintfState* ss, doub
     {
         const char* p = fin;
         while (*p) {
             MOZ_ASSERT(*p != 'L');
             p++;
         }
     }
 #endif
-    snprintf_literal(fout, fin, d);
+    SprintfLiteral(fout, fin, d);
 
     return (*ss->stuff)(ss, fout, strlen(fout));
 }
 
 static inline const char* generic_null_str(const char*) { return "(null)"; }
 static inline const char16_t* generic_null_str(const char16_t*) { return u"(null)"; }
 
 static inline size_t generic_strlen(const char* s) { return strlen(s); }
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1503,19 +1503,19 @@ Evaluate(JSContext* cx, unsigned argc, V
     }
 
     if (saveBytecode) {
         // If we are both loading and saving, we assert that we are going to
         // replace the current bytecode by the same stream of bytes.
         if (loadBytecode && assertEqBytecode) {
             if (saveLength != loadLength) {
                 char loadLengthStr[16];
-                snprintf_literal(loadLengthStr, "%" PRIu32, loadLength);
+                SprintfLiteral(loadLengthStr, "%" PRIu32, loadLength);
                 char saveLengthStr[16];
-                snprintf_literal(saveLengthStr,"%" PRIu32, saveLength);
+                SprintfLiteral(saveLengthStr,"%" PRIu32, saveLength);
 
                 JS_ReportErrorNumber(cx, my_GetErrorMessage, nullptr, JSSMSG_CACHE_EQ_SIZE_FAILED,
                                      loadLengthStr, saveLengthStr);
                 return false;
             }
 
             if (!PodEqual(loadBuffer, saveBuffer.get(), loadLength)) {
                 JS_ReportErrorNumber(cx, my_GetErrorMessage, nullptr,
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -1022,24 +1022,24 @@ LogTextPerfStats(gfxTextPerfMetrics* aTe
   if (!MOZ_LOG_TEST(tpLog, logLevel)) {
     return;
   }
 
   char prefix[256];
 
   switch (aLogType) {
     case eLog_reflow:
-      snprintf_literal(prefix, "(textperf-reflow) %p time-ms: %7.0f", aPresShell, aTime);
+      SprintfLiteral(prefix, "(textperf-reflow) %p time-ms: %7.0f", aPresShell, aTime);
       break;
     case eLog_loaddone:
-      snprintf_literal(prefix, "(textperf-loaddone) %p time-ms: %7.0f", aPresShell, aTime);
+      SprintfLiteral(prefix, "(textperf-loaddone) %p time-ms: %7.0f", aPresShell, aTime);
       break;
     default:
       MOZ_ASSERT(aLogType == eLog_totals, "unknown textperf log type");
-      snprintf_literal(prefix, "(textperf-totals) %p", aPresShell);
+      SprintfLiteral(prefix, "(textperf-totals) %p", aPresShell);
   }
 
   double hitRatio = 0.0;
   uint32_t lookups = aCounts.wordCacheHit + aCounts.wordCacheMiss;
   if (lookups) {
     hitRatio = double(aCounts.wordCacheHit) / double(lookups);
   }
 
@@ -10748,17 +10748,17 @@ void ReflowCountMgr::Add(const char * aN
     }
     counter->Add();
   }
 
   if ((mDumpFrameByFrameCounts || mPaintFrameByFrameCounts) &&
       nullptr != mIndiFrameCounts &&
       aFrame != nullptr) {
     char key[KEY_BUF_SIZE_FOR_PTR];
-    snprintf_literal(key, "%p", (void*)aFrame);
+    SprintfLiteral(key, "%p", (void*)aFrame);
     IndiReflowCounter * counter = (IndiReflowCounter *)PL_HashTableLookup(mIndiFrameCounts, key);
     if (counter == nullptr) {
       counter = new IndiReflowCounter(this);
       counter->mFrame = aFrame;
       counter->mName.AssignASCII(aName);
       PL_HashTableAdd(mIndiFrameCounts, NS_strdup(key), counter);
     }
     // this eliminates extra counts from super classes
@@ -10776,17 +10776,17 @@ void ReflowCountMgr::PaintCount(const ch
                                 nsIFrame*       aFrame,
                                 const nsPoint&  aOffset,
                                 uint32_t        aColor)
 {
   if (mPaintFrameByFrameCounts &&
       nullptr != mIndiFrameCounts &&
       aFrame != nullptr) {
     char key[KEY_BUF_SIZE_FOR_PTR];
-    snprintf_literal(key, "%p", (void*)aFrame);
+    SprintfLiteral(key, "%p", (void*)aFrame);
     IndiReflowCounter * counter =
       (IndiReflowCounter *)PL_HashTableLookup(mIndiFrameCounts, key);
     if (counter != nullptr && counter->mName.EqualsASCII(aName)) {
       DrawTarget* drawTarget = aRenderingContext->GetDrawTarget();
       int32_t appUnitsPerDevPixel = aPresContext->AppUnitsPerDevPixel();
 
       aRenderingContext->ThebesContext()->Save();
       gfxPoint devPixelOffset =
@@ -10799,17 +10799,17 @@ void ReflowCountMgr::PaintCount(const ch
       nsFont font(eFamily_serif, nsPresContext::CSSPixelsToAppUnits(11));
       nsFontMetrics::Params params;
       params.language = nsGkAtoms::x_western;
       params.textPerf = aPresContext->GetTextPerfMetrics();
       RefPtr<nsFontMetrics> fm =
         aPresContext->DeviceContext()->GetMetricsFor(font, params);
 
       char buf[16];
-      int len = snprintf_literal(buf, "%d", counter->mCount);
+      int len = SprintfLiteral(buf, "%d", counter->mCount);
       nscoord x = 0, y = fm->MaxAscent();
       nscoord width, height = fm->MaxHeight();
       fm->SetTextRunRTL(false);
       width = fm->GetWidth(buf, len, drawTarget);
 
       Color color;
       Color color2;
       if (aColor != 0) {
@@ -10920,17 +10920,17 @@ static void RecurseIndiTotals(nsPresCont
                               nsIFrame *      aParentFrame,
                               int32_t         aLevel)
 {
   if (aParentFrame == nullptr) {
     return;
   }
 
   char key[KEY_BUF_SIZE_FOR_PTR];
-  snprintf_literal(key, "%p", (void*)aParentFrame);
+  SprintfLiteral(key, "%p", (void*)aParentFrame);
   IndiReflowCounter * counter = (IndiReflowCounter *)PL_HashTableLookup(aHT, key);
   if (counter) {
     counter->mHasBeenOutput = true;
     char * name = ToNewCString(counter->mName);
     for (int32_t i=0;i<aLevel;i++) printf(" ");
     printf("%s - %p   [%d][", name, (void*)aParentFrame, counter->mCount);
     printf("%d", counter->mCounter.GetTotal());
     printf("]\n");
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -1442,19 +1442,19 @@ nsBlockFrame::Reflow(nsPresContext*     
     if (!numLines) numLines = 1;
     PRTime delta, perLineDelta, lines;
     lines = int64_t(numLines);
     delta = end - start;
     perLineDelta = delta / lines;
 
     ListTag(stdout);
     char buf[400];
-    snprintf_literal(buf,
-                     ": %" PRId64 " elapsed (%" PRId64 " per line) (%d lines; %d new lines)",
-                     delta, perLineDelta, numLines, ectc - ctc);
+    SprintfLiteral(buf,
+                   ": %" PRId64 " elapsed (%" PRId64 " per line) (%d lines; %d new lines)",
+                   delta, perLineDelta, numLines, ectc - ctc);
     printf("%s\n", buf);
   }
 #endif
 
   NS_FRAME_SET_TRUNCATION(aStatus, (*reflowInput), aMetrics);
 }
 
 bool
@@ -6620,20 +6620,20 @@ nsBlockFrame::BuildDisplayList(nsDisplay
     if (!numLines) numLines = 1;
     PRTime lines, deltaPerLine, delta;
     lines = int64_t(numLines);
     delta = end - start;
     deltaPerLine = delta / lines;
 
     ListTag(stdout);
     char buf[400];
-    snprintf_literal(buf,
-                     ": %" PRId64 " elapsed (%" PRId64 " per line) lines=%d drawn=%d skip=%d",
-                     delta, deltaPerLine,
-                     numLines, drawnLines, numLines - drawnLines);
+    SprintfLiteral(buf,
+                   ": %" PRId64 " elapsed (%" PRId64 " per line) lines=%d drawn=%d skip=%d",
+                   delta, deltaPerLine,
+                   numLines, drawnLines, numLines - drawnLines);
     printf("%s\n", buf);
   }
 #endif
 }
 
 #ifdef ACCESSIBILITY
 a11y::AccType
 nsBlockFrame::AccessibleType()
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6298,17 +6298,17 @@ nsFrame::MakeFrameName(const nsAString& 
       buf.AppendLiteral(" src=");
       buf.Append(src);
     }
     aResult.Append('(');
     aResult.Append(buf);
     aResult.Append(')');
   }
   char buf[40];
-  snprintf_literal(buf, "(%d)", ContentIndexInContainer(this));
+  SprintfLiteral(buf, "(%d)", ContentIndexInContainer(this));
   AppendASCIItoUTF16(buf, aResult);
   return NS_OK;
 }
 
 void
 nsIFrame::DumpFrameTree() const
 {
   RootFrameList(PresContext(), stderr);
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -312,17 +312,17 @@ nsPropertiesTable::ElementAt(DrawTarget*
       mGlyphCodeFonts.AppendElement(FontFamilyName(value, eUnquotedName)); // i.e., mGlyphCodeFonts[i] holds this font name
     }
   }
 
   // Update our cache if it is not associated to this character
   if (mCharCache != aChar) {
     // The key in the property file is interpreted as ASCII and kept
     // as such ...
-    char key[10]; snprintf_literal(key, "\\u%04X", aChar);
+    char key[10]; SprintfLiteral(key, "\\u%04X", aChar);
     nsAutoString value;
     nsresult rv = mGlyphProperties->GetStringProperty(nsDependentCString(key),
                                                       value);
     if (NS_FAILED(rv)) return kNullGlyph;
     Clean(value);
     // See if this char uses external fonts; e.g., if the 2nd glyph is taken
     // from the external font '1', the property line looks like
     // \uNNNN = \uNNNN\uNNNN@1\uNNNN.
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -1209,17 +1209,17 @@ FontFaceSet::LogMessage(gfxUserFontEntry
   char weightKeywordBuf[8]; // plenty to sprintf() a uint16_t
   const char* weightKeyword;
   const nsAFlatCString& weightKeywordString =
     nsCSSProps::ValueToKeyword(aUserFontEntry->Weight(),
                                nsCSSProps::kFontWeightKTable);
   if (weightKeywordString.Length() > 0) {
     weightKeyword = weightKeywordString.get();
   } else {
-    snprintf_literal(weightKeywordBuf, "%u", aUserFontEntry->Weight());
+    SprintfLiteral(weightKeywordBuf, "%u", aUserFontEntry->Weight());
     weightKeyword = weightKeywordBuf;
   }
 
   nsPrintfCString message
        ("downloadable font: %s "
         "(font-family: \"%s\" style:%s weight:%s stretch:%s src index:%d)",
         aMessage,
         familyName.get(),
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -6769,24 +6769,24 @@ CSSParserImpl::ParseColor(nsCSSValue& aV
     char buffer[20];
     switch (tk->mType) {
       case eCSSToken_Ident:
         str.Assign(tk->mIdent);
         break;
 
       case eCSSToken_Number:
         if (tk->mIntegerValid) {
-          snprintf_literal(buffer, "%06d", tk->mInteger);
+          SprintfLiteral(buffer, "%06d", tk->mInteger);
           str.AssignWithConversion(buffer);
         }
         break;
 
       case eCSSToken_Dimension:
         if (tk->mIdent.Length() <= 6) {
-          snprintf_literal(buffer, "%06.0f", tk->mNumber);
+          SprintfLiteral(buffer, "%06.0f", tk->mNumber);
           nsAutoString temp;
           temp.AssignWithConversion(buffer);
           temp.Right(str, 6 - tk->mIdent.Length());
           str.Append(tk->mIdent);
         }
         break;
       default:
         // There is a whole bunch of cases that are
--- a/mfbt/JSONWriter.h
+++ b/mfbt/JSONWriter.h
@@ -384,17 +384,17 @@ public:
 
   // Prints: <aBool>
   void BoolElement(bool aBool) { BoolProperty(nullptr, aBool); }
 
   // Prints: "<aName>": <aInt>
   void IntProperty(const char* aName, int64_t aInt)
   {
     char buf[64];
-    snprintf_literal(buf, "%" PRId64, aInt);
+    SprintfLiteral(buf, "%" PRId64, aInt);
     Scalar(aName, buf);
   }
 
   // Prints: <aInt>
   void IntElement(int64_t aInt) { IntProperty(nullptr, aInt); }
 
   // Prints: "<aName>": <aDouble>
   void DoubleProperty(const char* aName, double aDouble)
--- a/mfbt/Snprintf.h
+++ b/mfbt/Snprintf.h
@@ -16,17 +16,17 @@
 // In addition, in C++ code, on all platforms, provide an snprintf_literal()
 // function which uses template argument deduction to deduce the size of the
 // buffer, avoiding the need for the user to pass it in explicitly.
 #ifdef __cplusplus
 template <size_t N>
 #if defined(__GNUC__)
   __attribute__((format(printf, 2, 3)))
 #endif
-int snprintf_literal(char (&buffer)[N], const char* format, ...)
+int SprintfLiteral(char (&buffer)[N], const char* format, ...)
 {
   va_list args;
   va_start(args, format);
   int result = vsnprintf(buffer, N, format, args);
   va_end(args);
   buffer[N - 1] = '\0';
   return result;
 }
--- a/mfbt/tests/TestIntegerPrintfMacros.cpp
+++ b/mfbt/tests/TestIntegerPrintfMacros.cpp
@@ -29,204 +29,204 @@ PoisonOutput()
  *
  * In these names N is the width of the type as described in C99 7.18.1.
  */
 
 static void
 TestPrintSigned8()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRId8, int8_t(-17));
+  SprintfLiteral(gOutput, "%" PRId8, int8_t(-17));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-17"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIi8, int8_t(42));
+  SprintfLiteral(gOutput, "%" PRIi8, int8_t(42));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "42"));
 }
 
 static void
 TestPrintSigned16()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRId16, int16_t(-289));
+  SprintfLiteral(gOutput, "%" PRId16, int16_t(-289));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-289"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIi16, int16_t(728));
+  SprintfLiteral(gOutput, "%" PRIi16, int16_t(728));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "728"));
 }
 
 static void
 TestPrintSigned32()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRId32, int32_t(-342178));
+  SprintfLiteral(gOutput, "%" PRId32, int32_t(-342178));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-342178"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIi32, int32_t(5719283));
+  SprintfLiteral(gOutput, "%" PRIi32, int32_t(5719283));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "5719283"));
 }
 
 static void
 TestPrintSigned64()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRId64, int64_t(-INT64_C(432157943248732)));
+  SprintfLiteral(gOutput, "%" PRId64, int64_t(-INT64_C(432157943248732)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-432157943248732"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIi64, int64_t(INT64_C(325719232983)));
+  SprintfLiteral(gOutput, "%" PRIi64, int64_t(INT64_C(325719232983)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "325719232983"));
 }
 
 static void
 TestPrintSignedN()
 {
   TestPrintSigned8();
   TestPrintSigned16();
   TestPrintSigned32();
   TestPrintSigned64();
 }
 
 static void
 TestPrintSignedLeast8()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdLEAST8, int_least8_t(-17));
+  SprintfLiteral(gOutput, "%" PRIdLEAST8, int_least8_t(-17));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-17"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiLEAST8, int_least8_t(42));
+  SprintfLiteral(gOutput, "%" PRIiLEAST8, int_least8_t(42));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "42"));
 }
 
 static void
 TestPrintSignedLeast16()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdLEAST16, int_least16_t(-289));
+  SprintfLiteral(gOutput, "%" PRIdLEAST16, int_least16_t(-289));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-289"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiLEAST16, int_least16_t(728));
+  SprintfLiteral(gOutput, "%" PRIiLEAST16, int_least16_t(728));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "728"));
 }
 
 static void
 TestPrintSignedLeast32()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdLEAST32, int_least32_t(-342178));
+  SprintfLiteral(gOutput, "%" PRIdLEAST32, int_least32_t(-342178));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-342178"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiLEAST32, int_least32_t(5719283));
+  SprintfLiteral(gOutput, "%" PRIiLEAST32, int_least32_t(5719283));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "5719283"));
 }
 
 static void
 TestPrintSignedLeast64()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdLEAST64, int_least64_t(-INT64_C(432157943248732)));
+  SprintfLiteral(gOutput, "%" PRIdLEAST64, int_least64_t(-INT64_C(432157943248732)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-432157943248732"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiLEAST64, int_least64_t(INT64_C(325719232983)));
+  SprintfLiteral(gOutput, "%" PRIiLEAST64, int_least64_t(INT64_C(325719232983)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "325719232983"));
 }
 
 static void
 TestPrintSignedLeastN()
 {
   TestPrintSignedLeast8();
   TestPrintSignedLeast16();
   TestPrintSignedLeast32();
   TestPrintSignedLeast64();
 }
 
 static void
 TestPrintSignedFast8()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdFAST8, int_fast8_t(-17));
+  SprintfLiteral(gOutput, "%" PRIdFAST8, int_fast8_t(-17));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-17"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiFAST8, int_fast8_t(42));
+  SprintfLiteral(gOutput, "%" PRIiFAST8, int_fast8_t(42));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "42"));
 }
 
 static void
 TestPrintSignedFast16()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdFAST16, int_fast16_t(-289));
+  SprintfLiteral(gOutput, "%" PRIdFAST16, int_fast16_t(-289));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-289"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiFAST16, int_fast16_t(728));
+  SprintfLiteral(gOutput, "%" PRIiFAST16, int_fast16_t(728));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "728"));
 }
 
 static void
 TestPrintSignedFast32()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdFAST32, int_fast32_t(-342178));
+  SprintfLiteral(gOutput, "%" PRIdFAST32, int_fast32_t(-342178));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-342178"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiFAST32, int_fast32_t(5719283));
+  SprintfLiteral(gOutput, "%" PRIiFAST32, int_fast32_t(5719283));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "5719283"));
 }
 
 static void
 TestPrintSignedFast64()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdFAST64, int_fast64_t(-INT64_C(432157943248732)));
+  SprintfLiteral(gOutput, "%" PRIdFAST64, int_fast64_t(-INT64_C(432157943248732)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-432157943248732"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiFAST64, int_fast64_t(INT64_C(325719232983)));
+  SprintfLiteral(gOutput, "%" PRIiFAST64, int_fast64_t(INT64_C(325719232983)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "325719232983"));
 }
 
 static void
 TestPrintSignedFastN()
 {
   TestPrintSignedFast8();
   TestPrintSignedFast16();
   TestPrintSignedFast32();
   TestPrintSignedFast64();
 }
 
 static void
 TestPrintSignedMax()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdMAX, intmax_t(-INTMAX_C(432157943248732)));
+  SprintfLiteral(gOutput, "%" PRIdMAX, intmax_t(-INTMAX_C(432157943248732)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "-432157943248732"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiMAX, intmax_t(INTMAX_C(325719232983)));
+  SprintfLiteral(gOutput, "%" PRIiMAX, intmax_t(INTMAX_C(325719232983)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "325719232983"));
 }
 
 static void
 TestPrintSignedPtr()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIdPTR, intptr_t(reinterpret_cast<void*>(12345678)));
+  SprintfLiteral(gOutput, "%" PRIdPTR, intptr_t(reinterpret_cast<void*>(12345678)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "12345678"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIiPTR, intptr_t(reinterpret_cast<void*>(87654321)));
+  SprintfLiteral(gOutput, "%" PRIiPTR, intptr_t(reinterpret_cast<void*>(87654321)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "87654321"));
 }
 
 static void
 TestPrintSigned()
 {
   TestPrintSignedN();
   TestPrintSignedLeastN();
@@ -245,318 +245,318 @@ TestPrintSigned()
  *
  * In these names N is the width of the type as described in C99 7.18.1.
  */
 
 static void
 TestPrintUnsigned8()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIo8, uint8_t(042));
+  SprintfLiteral(gOutput, "%" PRIo8, uint8_t(042));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "42"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIu8, uint8_t(17));
+  SprintfLiteral(gOutput, "%" PRIu8, uint8_t(17));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "17"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIx8, uint8_t(0x2a));
+  SprintfLiteral(gOutput, "%" PRIx8, uint8_t(0x2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIX8, uint8_t(0xCD));
+  SprintfLiteral(gOutput, "%" PRIX8, uint8_t(0xCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CD"));
 }
 
 static void
 TestPrintUnsigned16()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIo16, uint16_t(04242));
+  SprintfLiteral(gOutput, "%" PRIo16, uint16_t(04242));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "4242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIu16, uint16_t(1717));
+  SprintfLiteral(gOutput, "%" PRIu16, uint16_t(1717));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "1717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIx16, uint16_t(0x2a2a));
+  SprintfLiteral(gOutput, "%" PRIx16, uint16_t(0x2a2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIX16, uint16_t(0xCDCD));
+  SprintfLiteral(gOutput, "%" PRIX16, uint16_t(0xCDCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCD"));
 }
 
 static void
 TestPrintUnsigned32()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIo32, uint32_t(0424242));
+  SprintfLiteral(gOutput, "%" PRIo32, uint32_t(0424242));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "424242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIu32, uint32_t(171717));
+  SprintfLiteral(gOutput, "%" PRIu32, uint32_t(171717));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "171717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIx32, uint32_t(0x2a2a2a));
+  SprintfLiteral(gOutput, "%" PRIx32, uint32_t(0x2a2a2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIX32, uint32_t(0xCDCDCD));
+  SprintfLiteral(gOutput, "%" PRIX32, uint32_t(0xCDCDCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCDCD"));
 }
 
 static void
 TestPrintUnsigned64()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIo64, uint64_t(UINT64_C(0424242424242)));
+  SprintfLiteral(gOutput, "%" PRIo64, uint64_t(UINT64_C(0424242424242)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "424242424242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIu64, uint64_t(UINT64_C(17171717171717171717)));
+  SprintfLiteral(gOutput, "%" PRIu64, uint64_t(UINT64_C(17171717171717171717)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "17171717171717171717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIx64, uint64_t(UINT64_C(0x2a2a2a2a2a2a2a)));
+  SprintfLiteral(gOutput, "%" PRIx64, uint64_t(UINT64_C(0x2a2a2a2a2a2a2a)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a2a2a2a2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIX64, uint64_t(UINT64_C(0xCDCDCDCDCDCD)));
+  SprintfLiteral(gOutput, "%" PRIX64, uint64_t(UINT64_C(0xCDCDCDCDCDCD)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCDCDCDCDCD"));
 }
 
 static void
 TestPrintUnsignedN()
 {
   TestPrintUnsigned8();
   TestPrintUnsigned16();
   TestPrintUnsigned32();
   TestPrintUnsigned64();
 }
 
 static void
 TestPrintUnsignedLeast8()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoLEAST8, uint_least8_t(042));
+  SprintfLiteral(gOutput, "%" PRIoLEAST8, uint_least8_t(042));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "42"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuLEAST8, uint_least8_t(17));
+  SprintfLiteral(gOutput, "%" PRIuLEAST8, uint_least8_t(17));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "17"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxLEAST8, uint_least8_t(0x2a));
+  SprintfLiteral(gOutput, "%" PRIxLEAST8, uint_least8_t(0x2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXLEAST8, uint_least8_t(0xCD));
+  SprintfLiteral(gOutput, "%" PRIXLEAST8, uint_least8_t(0xCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CD"));
 }
 
 static void
 TestPrintUnsignedLeast16()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoLEAST16, uint_least16_t(04242));
+  SprintfLiteral(gOutput, "%" PRIoLEAST16, uint_least16_t(04242));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "4242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuLEAST16, uint_least16_t(1717));
+  SprintfLiteral(gOutput, "%" PRIuLEAST16, uint_least16_t(1717));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "1717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxLEAST16, uint_least16_t(0x2a2a));
+  SprintfLiteral(gOutput, "%" PRIxLEAST16, uint_least16_t(0x2a2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXLEAST16, uint_least16_t(0xCDCD));
+  SprintfLiteral(gOutput, "%" PRIXLEAST16, uint_least16_t(0xCDCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCD"));
 }
 
 static void
 TestPrintUnsignedLeast32()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoLEAST32, uint_least32_t(0424242));
+  SprintfLiteral(gOutput, "%" PRIoLEAST32, uint_least32_t(0424242));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "424242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuLEAST32, uint_least32_t(171717));
+  SprintfLiteral(gOutput, "%" PRIuLEAST32, uint_least32_t(171717));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "171717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxLEAST32, uint_least32_t(0x2a2a2a));
+  SprintfLiteral(gOutput, "%" PRIxLEAST32, uint_least32_t(0x2a2a2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXLEAST32, uint_least32_t(0xCDCDCD));
+  SprintfLiteral(gOutput, "%" PRIXLEAST32, uint_least32_t(0xCDCDCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCDCD"));
 }
 
 static void
 TestPrintUnsignedLeast64()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoLEAST64, uint_least64_t(UINT64_C(0424242424242)));
+  SprintfLiteral(gOutput, "%" PRIoLEAST64, uint_least64_t(UINT64_C(0424242424242)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "424242424242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuLEAST64,
-          uint_least64_t(UINT64_C(17171717171717171717)));
+  SprintfLiteral(gOutput, "%" PRIuLEAST64,
+                 uint_least64_t(UINT64_C(17171717171717171717)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "17171717171717171717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxLEAST64, uint_least64_t(UINT64_C(0x2a2a2a2a2a2a2a)));
+  SprintfLiteral(gOutput, "%" PRIxLEAST64, uint_least64_t(UINT64_C(0x2a2a2a2a2a2a2a)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a2a2a2a2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXLEAST64, uint_least64_t(UINT64_C(0xCDCDCDCDCDCD)));
+  SprintfLiteral(gOutput, "%" PRIXLEAST64, uint_least64_t(UINT64_C(0xCDCDCDCDCDCD)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCDCDCDCDCD"));
 }
 
 static void
 TestPrintUnsignedLeastN()
 {
   TestPrintUnsignedLeast8();
   TestPrintUnsignedLeast16();
   TestPrintUnsignedLeast32();
   TestPrintUnsignedLeast64();
 }
 
 static void
 TestPrintUnsignedFast8()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoFAST8, uint_fast8_t(042));
+  SprintfLiteral(gOutput, "%" PRIoFAST8, uint_fast8_t(042));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "42"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuFAST8, uint_fast8_t(17));
+  SprintfLiteral(gOutput, "%" PRIuFAST8, uint_fast8_t(17));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "17"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxFAST8, uint_fast8_t(0x2a));
+  SprintfLiteral(gOutput, "%" PRIxFAST8, uint_fast8_t(0x2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXFAST8, uint_fast8_t(0xCD));
+  SprintfLiteral(gOutput, "%" PRIXFAST8, uint_fast8_t(0xCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CD"));
 }
 
 static void
 TestPrintUnsignedFast16()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoFAST16, uint_fast16_t(04242));
+  SprintfLiteral(gOutput, "%" PRIoFAST16, uint_fast16_t(04242));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "4242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuFAST16, uint_fast16_t(1717));
+  SprintfLiteral(gOutput, "%" PRIuFAST16, uint_fast16_t(1717));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "1717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxFAST16, uint_fast16_t(0x2a2a));
+  SprintfLiteral(gOutput, "%" PRIxFAST16, uint_fast16_t(0x2a2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXFAST16, uint_fast16_t(0xCDCD));
+  SprintfLiteral(gOutput, "%" PRIXFAST16, uint_fast16_t(0xCDCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCD"));
 }
 
 static void
 TestPrintUnsignedFast32()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoFAST32, uint_fast32_t(0424242));
+  SprintfLiteral(gOutput, "%" PRIoFAST32, uint_fast32_t(0424242));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "424242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuFAST32, uint_fast32_t(171717));
+  SprintfLiteral(gOutput, "%" PRIuFAST32, uint_fast32_t(171717));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "171717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxFAST32, uint_fast32_t(0x2a2a2a));
+  SprintfLiteral(gOutput, "%" PRIxFAST32, uint_fast32_t(0x2a2a2a));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXFAST32, uint_fast32_t(0xCDCDCD));
+  SprintfLiteral(gOutput, "%" PRIXFAST32, uint_fast32_t(0xCDCDCD));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCDCD"));
 }
 
 static void
 TestPrintUnsignedFast64()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoFAST64, uint_fast64_t(UINT64_C(0424242424242)));
+  SprintfLiteral(gOutput, "%" PRIoFAST64, uint_fast64_t(UINT64_C(0424242424242)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "424242424242"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuFAST64,
+  SprintfLiteral(gOutput, "%" PRIuFAST64,
           uint_fast64_t(UINT64_C(17171717171717171717)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "17171717171717171717"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxFAST64, uint_fast64_t(UINT64_C(0x2a2a2a2a2a2a2a)));
+  SprintfLiteral(gOutput, "%" PRIxFAST64, uint_fast64_t(UINT64_C(0x2a2a2a2a2a2a2a)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "2a2a2a2a2a2a2a"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXFAST64, uint_fast64_t(UINT64_C(0xCDCDCDCDCDCD)));
+  SprintfLiteral(gOutput, "%" PRIXFAST64, uint_fast64_t(UINT64_C(0xCDCDCDCDCDCD)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "CDCDCDCDCDCD"));
 }
 
 static void
 TestPrintUnsignedFastN()
 {
   TestPrintUnsignedFast8();
   TestPrintUnsignedFast16();
   TestPrintUnsignedFast32();
   TestPrintUnsignedFast64();
 }
 
 static void
 TestPrintUnsignedMax()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoMAX, uintmax_t(UINTMAX_C(432157943248732)));
+  SprintfLiteral(gOutput, "%" PRIoMAX, uintmax_t(UINTMAX_C(432157943248732)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "14220563454333534"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuMAX, uintmax_t(UINTMAX_C(325719232983)));
+  SprintfLiteral(gOutput, "%" PRIuMAX, uintmax_t(UINTMAX_C(325719232983)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "325719232983"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxMAX, uintmax_t(UINTMAX_C(327281321873)));
+  SprintfLiteral(gOutput, "%" PRIxMAX, uintmax_t(UINTMAX_C(327281321873)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "4c337ca791"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXMAX, uintmax_t(UINTMAX_C(912389523743523)));
+  SprintfLiteral(gOutput, "%" PRIXMAX, uintmax_t(UINTMAX_C(912389523743523)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "33DD03D75A323"));
 }
 
 static void
 TestPrintUnsignedPtr()
 {
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIoPTR, uintptr_t(reinterpret_cast<void*>(12345678)));
+  SprintfLiteral(gOutput, "%" PRIoPTR, uintptr_t(reinterpret_cast<void*>(12345678)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "57060516"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIuPTR, uintptr_t(reinterpret_cast<void*>(87654321)));
+  SprintfLiteral(gOutput, "%" PRIuPTR, uintptr_t(reinterpret_cast<void*>(87654321)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "87654321"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIxPTR, uintptr_t(reinterpret_cast<void*>(0x4c3a791)));
+  SprintfLiteral(gOutput, "%" PRIxPTR, uintptr_t(reinterpret_cast<void*>(0x4c3a791)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "4c3a791"));
 
   PoisonOutput();
-  snprintf_literal(gOutput, "%" PRIXPTR, uintptr_t(reinterpret_cast<void*>(0xF328DB)));
+  SprintfLiteral(gOutput, "%" PRIXPTR, uintptr_t(reinterpret_cast<void*>(0xF328DB)));
   MOZ_RELEASE_ASSERT(!strcmp(gOutput, "F328DB"));
 }
 
 static void
 TestPrintUnsigned()
 {
   TestPrintUnsignedN();
   TestPrintUnsignedLeastN();
--- a/mozglue/misc/TimeStamp_posix.cpp
+++ b/mozglue/misc/TimeStamp_posix.cpp
@@ -265,17 +265,17 @@ ComputeProcessUptimeThread(void* aTime)
 
   *uptime = 0;
 
   if (!hz) {
     return nullptr;
   }
 
   char threadStat[40];
-  snprintf_literal(threadStat, "/proc/self/task/%d/stat", (pid_t)syscall(__NR_gettid));
+  SprintfLiteral(threadStat, "/proc/self/task/%d/stat", (pid_t)syscall(__NR_gettid));
 
   uint64_t threadJiffies = JiffiesSinceBoot(threadStat);
   uint64_t selfJiffies = JiffiesSinceBoot("/proc/self/stat");
 
   if (!threadJiffies || !selfJiffies) {
     return nullptr;
   }
 
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -413,31 +413,31 @@ nsOfflineCacheBinding::Create(nsIFile *c
   char leaf[64];
 
   if (generation == -1)
   {
     file->AppendNative(NS_LITERAL_CSTRING("placeholder"));
 
     for (generation = 0; ; ++generation)
     {
-      snprintf_literal(leaf, "%014" PRIX64 "-%X", hash, generation);
+      SprintfLiteral(leaf, "%014" PRIX64 "-%X", hash, generation);
 
       rv = file->SetNativeLeafName(nsDependentCString(leaf));
       if (NS_FAILED(rv))
         return nullptr;
       rv = file->Create(nsIFile::NORMAL_FILE_TYPE, 00600);
       if (NS_FAILED(rv) && rv != NS_ERROR_FILE_ALREADY_EXISTS)
         return nullptr;
       if (NS_SUCCEEDED(rv))
         break;
     }
   }
   else
   {
-    snprintf_literal(leaf, "%014" PRIX64 "-%X", hash, generation);
+    SprintfLiteral(leaf, "%014" PRIX64 "-%X", hash, generation);
     rv = file->AppendNative(nsDependentCString(leaf));
     if (NS_FAILED(rv))
       return nullptr;
   }
 
   nsOfflineCacheBinding *binding = new nsOfflineCacheBinding;
   if (!binding)
     return nullptr;
--- a/netwerk/cache/nsDiskCacheMap.cpp
+++ b/netwerk/cache/nsDiskCacheMap.cpp
@@ -1121,18 +1121,18 @@ nsDiskCacheMap::GetFileForDiskCacheRecor
     if (createPath && (NS_FAILED(file->Exists(&exists)) || !exists)) {
         rv = file->Create(nsIFile::DIRECTORY_TYPE, 0700);
         if (NS_FAILED(rv))  return rv;
     }
 
     int16_t generation = record->Generation();
     char name[32];
     // Cut the beginning of the hash that was used in the path
-    ::snprintf_literal(name, "%05X%c%02X", hash & 0xFFFFF, (meta ? 'm' : 'd'),
-               generation);
+    ::SprintfLiteral(name, "%05X%c%02X", hash & 0xFFFFF, (meta ? 'm' : 'd'),
+                     generation);
     rv = file->AppendNative(nsDependentCString(name));
     if (NS_FAILED(rv))  return rv;
     
     NS_IF_ADDREF(*result = file);
     return rv;
 }
 
 
@@ -1159,17 +1159,17 @@ nsDiskCacheMap::GetBlockFileForIndex(uin
 {
     if (!mCacheDirectory)  return NS_ERROR_NOT_AVAILABLE;
     
     nsCOMPtr<nsIFile> file;
     nsresult rv = mCacheDirectory->Clone(getter_AddRefs(file));
     if (NS_FAILED(rv))  return rv;
     
     char name[32];
-    ::snprintf_literal(name, "_CACHE_%03d_", index + 1);
+    ::SprintfLiteral(name, "_CACHE_%03d_", index + 1);
     rv = file->AppendNative(nsDependentCString(name));
     if (NS_FAILED(rv))  return rv;
     
     NS_IF_ADDREF(*result = file);
 
     return rv;
 }
 
--- a/netwerk/protocol/rtsp/rtsp/ASessionDescription.cpp
+++ b/netwerk/protocol/rtsp/rtsp/ASessionDescription.cpp
@@ -211,41 +211,41 @@ bool ASessionDescription::getFormatType(
     unsigned long x = strtoul(lastSpacePos + 1, &end, 10);
     if (end <= lastSpacePos + 1 || *end != '\0') {
         return false;
     }
 
     *PT = x;
 
     char key[20];
-    snprintf_literal(key, "a=rtpmap:%lu", x);
+    SprintfLiteral(key, "a=rtpmap:%lu", x);
 
     if (!findAttribute(index, key, desc)) {
         // We only support dynamic payload type assignment for now.
         // If SDP description doesn't have the "a=rtpmap:" line, it is static
         // payload type assignment and we refuse to handle it.
         return false;
     }
 
-    snprintf_literal(key, "a=fmtp:%lu", x);
+    SprintfLiteral(key, "a=fmtp:%lu", x);
     if (!findAttribute(index, key, params)) {
         params->clear();
     }
 
     return true;
 }
 
 bool ASessionDescription::getDimensions(
         size_t index, unsigned long PT,
         int32_t *width, int32_t *height) const {
     *width = 0;
     *height = 0;
 
     char key[20];
-    snprintf_literal(key, "a=framesize:%lu", PT);
+    SprintfLiteral(key, "a=framesize:%lu", PT);
     AString value;
     if (!findAttribute(index, key, &value)) {
         return false;
     }
 
     const char *s = value.c_str();
     char *end;
     *width = strtoul(s, &end, 10);
--- a/netwerk/streamconv/converters/ParseFTPList.cpp
+++ b/netwerk/streamconv/converters/ParseFTPList.cpp
@@ -482,17 +482,17 @@ int ParseFTPList(const char *line, struc
                * A block is always 512 bytes on OpenVMS, compute size.
                * So its rounded up to the next block, so what, its better
                * than not showing the size at all.
                * A block is always 512 bytes on OpenVMS, compute size.
                * So its rounded up to the next block, so what, its better
                * than not showing the size at all.
               */
               uint64_t fsz = uint64_t(strtoul(tokens[1], (char **)0, 10) * 512);
-              snprintf_literal(result->fe_size, "%" PRId64, fsz);
+              SprintfLiteral(result->fe_size, "%" PRId64, fsz);
             } 
 
           } /* if (result->fe_type != 'd') */
 
           p = tokens[2] + 2;
           if (*p == '-')
             p++;
           tbuf[0] = p[0];
--- a/netwerk/test/PropertiesTest.cpp
+++ b/netwerk/test/PropertiesTest.cpp
@@ -72,17 +72,17 @@ main(int argc, char* argv[])
   if (NS_FAILED(ret)) {
     printf("cannot load properties\n");
     return 1;
   }
   int i = 1;
   while (1) {
     char name[16];
     name[0] = 0;
-    snprintf_literal(name, "%d", i);
+    SprintfLiteral(name, "%d", i);
     nsAutoString v;
     ret = props->GetStringProperty(nsDependentCString(name), v);
     if (NS_FAILED(ret) || (!v.Length())) {
       break;
     }
     printf("\"%d\"=\"%s\"\n", i, NS_ConvertUTF16toUTF8(v).get());
     i++;
   }
--- a/netwerk/test/urltest.cpp
+++ b/netwerk/test/urltest.cpp
@@ -88,17 +88,17 @@ nsresult writeoutto(const char* i_pURL, 
         rv = tURL->GetPassword(temp);
         output += RESULT();
         output += ',';
         rv = tURL->GetHost(temp);
         output += RESULT();
         output += ',';
         rv = tURL->GetPort(&port);
         char portbuffer[40];
-        snprintf_literal(portbuffer, "%d", port);
+        SprintfLiteral(portbuffer, "%d", port);
         output.Append(portbuffer);
         output += ',';
         rv = tURL->GetDirectory(temp);
         output += RESULT();
         output += ',';
         rv = tURL->GetFileBaseName(temp);
         output += RESULT();
         output += ',';
--- a/security/manager/ssl/nsNSSCertHelper.cpp
+++ b/security/manager/ssl/nsNSSCertHelper.cpp
@@ -622,17 +622,17 @@ ProcessRawBytes(nsINSSComponent *nssComp
   // This prints the value of the byte out into a 
   // string that can later be displayed as a byte
   // string.  We place a new line after 24 bytes
   // to break up extermaly long sequence of bytes.
 
   uint32_t i;
   char buffer[5];
   for (i=0; i<data->len; i++) {
-    snprintf_literal(buffer, "%02x ", data->data[i]);
+    SprintfLiteral(buffer, "%02x ", data->data[i]);
     AppendASCIItoUTF16(buffer, text);
     if ((i+1)%16 == 0) {
       text.AppendLiteral(SEPARATOR);
     }
   }
   return NS_OK;
 }
 
@@ -966,17 +966,17 @@ ProcessGeneralName(const UniquePLArenaPo
 	SECItem guid;
 	nssComponent->GetPIPNSSBundleString("CertDumpMSDomainGUID", key);
         if (SEC_ASN1DecodeItem(arena.get(), &guid,
 			       SEC_ASN1_GET(SEC_OctetStringTemplate),
 			       &current->name.OthName.name) == SECSuccess
 	    && guid.len == 16) {
 	  char buf[40];
 	  unsigned char *d = guid.data;
-          snprintf_literal(buf,
+          SprintfLiteral(buf,
             "{%.2x%.2x%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x%.2x%.2x%.2x%.2x}",
             d[3], d[2], d[1], d[0], d[5], d[4], d[7], d[6],
             d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]);
 	  value.AssignASCII(buf);
 	} else {
 	  ProcessRawBytes(nssComponent, &current->name.OthName.name, value);
 	}
     } else {
@@ -1194,17 +1194,17 @@ ProcessUserNotice(SECItem* derNotice, ns
       break;
     }
     text.AppendLiteral(" - ");
     SECItem** itemList = notice->noticeReference.noticeNumbers;
     while (*itemList) {
       unsigned long number;
       char buffer[60];
       if (SEC_ASN1DecodeInteger(*itemList, &number) == SECSuccess) {
-        snprintf_literal(buffer, "#%lu", number);
+        SprintfLiteral(buffer, "#%lu", number);
         if (itemList != notice->noticeReference.noticeNumbers)
           text.AppendLiteral(", ");
         AppendASCIItoUTF16(buffer, text);
       }
       itemList++;
     }
   }
   if (notice->displayText.len != 0) {
@@ -1483,17 +1483,17 @@ ProcessMSCAVersion(SECItem  *extData,
   unsigned long version;
   if (SEC_ASN1DecodeInteger(&decoded, &version) != SECSuccess) {
     /* Value out of range, display raw bytes */
     return ProcessRawBytes(nssComponent, extData, text);
   }
 
   /* Apparently, the encoding is <minor><major>, with 16 bits each */
   char buf[50];
-  if (snprintf_literal(buf, "%lu.%lu", version & 0xFFFF, version >> 16) <= 0) {
+  if (SprintfLiteral(buf, "%lu.%lu", version & 0xFFFF, version >> 16) <= 0) {
     return NS_ERROR_FAILURE;
   }
 
   text.AppendASCII(buf);
   return NS_OK;
 }
 
 static nsresult
--- a/testing/mochitest/ssltunnel/ssltunnel.cpp
+++ b/testing/mochitest/ssltunnel/ssltunnel.cpp
@@ -522,17 +522,17 @@ bool AdjustWebSocketHost(relayBuffer& bu
 
   // Save the original host, so we can use it later on responses from the
   // server.
   ci->original_host.assign(host, endhost-host);
 
   char newhost[40];
   PR_NetAddrToString(&inet_addr, newhost, sizeof(newhost));
   assert(strlen(newhost) < sizeof(newhost) - 7);
-  snprintf_literal(newhost, "%s:%d", newhost, PR_ntohs(inet_addr.inet.port));
+  SprintfLiteral(newhost, "%s:%d", newhost, PR_ntohs(inet_addr.inet.port));
 
   int diff = strlen(newhost) - (endhost-host);
   if (diff > 0)
     assert(size_t(diff) <= buffer.margin());
   memmove(endhost + diff, endhost, buffer.buffertail - host - diff);
   buffer.buffertail += diff;
 
   memcpy(host, newhost, strlen(newhost));
--- a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
@@ -482,17 +482,17 @@ nsUrlClassifierUtils::CanonicalNum(const
       return;
     }
   } else {
     return;
   }
 
   while (bytes--) {
     char buf[20];
-    snprintf_literal(buf, "%u", val & 0xff);
+    SprintfLiteral(buf, "%u", val & 0xff);
     if (_retval.IsEmpty()) {
       _retval.Assign(buf);
     } else {
       _retval = nsDependentCString(buf) + NS_LITERAL_CSTRING(".") + _retval;
     }
     val >>= 8;
   }
 }
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -1793,17 +1793,17 @@ GetOrInit(nsIFile* aDir, const nsACStrin
 
 // Init the "install time" data.  We're taking an easy way out here
 // and just setting this to "the time when this version was first run".
 static nsresult
 InitInstallTime(nsACString& aInstallTime)
 {
   time_t t = time(nullptr);
   char buf[16];
-  snprintf_literal(buf, "%ld", t);
+  SprintfLiteral(buf, "%ld", t);
   aInstallTime = buf;
 
   return NS_OK;
 }
 
 // Ensure a directory exists and create it if missing.
 static nsresult
 EnsureDirectoryExists(nsIFile* dir)
--- a/tools/profiler/core/ProfilerMarkers.cpp
+++ b/tools/profiler/core/ProfilerMarkers.cpp
@@ -169,17 +169,17 @@ LayerTranslationPayload::LayerTranslatio
 }
 
 void
 LayerTranslationPayload::StreamPayload(SpliceableJSONWriter& aWriter,
                                        UniqueStacks& aUniqueStacks)
 {
   const size_t bufferSize = 32;
   char buffer[bufferSize];
-  snprintf_literal(buffer, "%p", mLayer);
+  SprintfLiteral(buffer, "%p", mLayer);
 
   aWriter.StringProperty("layer", buffer);
   aWriter.IntProperty("x", mPoint.x);
   aWriter.IntProperty("y", mPoint.y);
   aWriter.StringProperty("category", "LayerTranslation");
 }
 
 TouchDataPayload::TouchDataPayload(const mozilla::ScreenIntPoint& aPoint)
--- a/tools/profiler/lul/LulDwarf.cpp
+++ b/tools/profiler/lul/LulDwarf.cpp
@@ -1659,151 +1659,151 @@ const char *CallFrameInfo::KindName(Entr
 bool CallFrameInfo::ReportIncomplete(Entry *entry) {
   reporter_->Incomplete(entry->offset, entry->kind);
   return false;
 }
 
 void CallFrameInfo::Reporter::Incomplete(uint64 offset,
                                          CallFrameInfo::EntryKind kind) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI %s at offset 0x%llx in '%s': entry ends early\n",
-                   filename_.c_str(), CallFrameInfo::KindName(kind), offset,
-                   section_.c_str());
+  SprintfLiteral(buf,
+                 "%s: CFI %s at offset 0x%llx in '%s': entry ends early\n",
+                 filename_.c_str(), CallFrameInfo::KindName(kind), offset,
+                 section_.c_str());
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::EarlyEHTerminator(uint64 offset) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI at offset 0x%llx in '%s': saw end-of-data marker"
-                   " before end of section contents\n",
-                   filename_.c_str(), offset, section_.c_str());
+  SprintfLiteral(buf,
+                 "%s: CFI at offset 0x%llx in '%s': saw end-of-data marker"
+                 " before end of section contents\n",
+                 filename_.c_str(), offset, section_.c_str());
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::CIEPointerOutOfRange(uint64 offset,
                                                    uint64 cie_offset) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI frame description entry at offset 0x%llx in '%s':"
-                   " CIE pointer is out of range: 0x%llx\n",
-                   filename_.c_str(), offset, section_.c_str(), cie_offset);
+  SprintfLiteral(buf,
+                 "%s: CFI frame description entry at offset 0x%llx in '%s':"
+                 " CIE pointer is out of range: 0x%llx\n",
+                 filename_.c_str(), offset, section_.c_str(), cie_offset);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::BadCIEId(uint64 offset, uint64 cie_offset) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI frame description entry at offset 0x%llx in '%s':"
-                   " CIE pointer does not point to a CIE: 0x%llx\n",
-                   filename_.c_str(), offset, section_.c_str(), cie_offset);
+  SprintfLiteral(buf,
+                 "%s: CFI frame description entry at offset 0x%llx in '%s':"
+                 " CIE pointer does not point to a CIE: 0x%llx\n",
+                 filename_.c_str(), offset, section_.c_str(), cie_offset);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::UnrecognizedVersion(uint64 offset, int version) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI frame description entry at offset 0x%llx in '%s':"
-                   " CIE specifies unrecognized version: %d\n",
-                   filename_.c_str(), offset, section_.c_str(), version);
+  SprintfLiteral(buf,
+                 "%s: CFI frame description entry at offset 0x%llx in '%s':"
+                 " CIE specifies unrecognized version: %d\n",
+                 filename_.c_str(), offset, section_.c_str(), version);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64 offset,
                                                        const string &aug) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI frame description entry at offset 0x%llx in '%s':"
-                   " CIE specifies unrecognized augmentation: '%s'\n",
-                   filename_.c_str(), offset, section_.c_str(), aug.c_str());
+  SprintfLiteral(buf,
+                 "%s: CFI frame description entry at offset 0x%llx in '%s':"
+                 " CIE specifies unrecognized augmentation: '%s'\n",
+                 filename_.c_str(), offset, section_.c_str(), aug.c_str());
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::InvalidPointerEncoding(uint64 offset,
                                                      uint8 encoding) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI common information entry at offset 0x%llx in '%s':"
-                   " 'z' augmentation specifies invalid pointer encoding: "
-                   "0x%02x\n",
-                   filename_.c_str(), offset, section_.c_str(), encoding);
+  SprintfLiteral(buf,
+                 "%s: CFI common information entry at offset 0x%llx in '%s':"
+                 " 'z' augmentation specifies invalid pointer encoding: "
+                 "0x%02x\n",
+                 filename_.c_str(), offset, section_.c_str(), encoding);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::UnusablePointerEncoding(uint64 offset,
                                                       uint8 encoding) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI common information entry at offset 0x%llx in '%s':"
-                   " 'z' augmentation specifies a pointer encoding for which"
-                   " we have no base address: 0x%02x\n",
-                   filename_.c_str(), offset, section_.c_str(), encoding);
+  SprintfLiteral(buf,
+                 "%s: CFI common information entry at offset 0x%llx in '%s':"
+                 " 'z' augmentation specifies a pointer encoding for which"
+                 " we have no base address: 0x%02x\n",
+                 filename_.c_str(), offset, section_.c_str(), encoding);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::RestoreInCIE(uint64 offset, uint64 insn_offset) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI common information entry at offset 0x%llx in '%s':"
-                   " the DW_CFA_restore instruction at offset 0x%llx"
-                   " cannot be used in a common information entry\n",
-                   filename_.c_str(), offset, section_.c_str(), insn_offset);
+  SprintfLiteral(buf,
+                 "%s: CFI common information entry at offset 0x%llx in '%s':"
+                 " the DW_CFA_restore instruction at offset 0x%llx"
+                 " cannot be used in a common information entry\n",
+                 filename_.c_str(), offset, section_.c_str(), insn_offset);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::BadInstruction(uint64 offset,
                                              CallFrameInfo::EntryKind kind,
                                              uint64 insn_offset) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI %s at offset 0x%llx in section '%s':"
-                   " the instruction at offset 0x%llx is unrecognized\n",
-                   filename_.c_str(), CallFrameInfo::KindName(kind),
-                   offset, section_.c_str(), insn_offset);
+  SprintfLiteral(buf,
+                 "%s: CFI %s at offset 0x%llx in section '%s':"
+                 " the instruction at offset 0x%llx is unrecognized\n",
+                 filename_.c_str(), CallFrameInfo::KindName(kind),
+                 offset, section_.c_str(), insn_offset);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::NoCFARule(uint64 offset,
                                         CallFrameInfo::EntryKind kind,
                                         uint64 insn_offset) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI %s at offset 0x%llx in section '%s':"
-                   " the instruction at offset 0x%llx assumes that a CFA rule "
-                   "has been set, but none has been set\n",
-                   filename_.c_str(), CallFrameInfo::KindName(kind), offset,
-                   section_.c_str(), insn_offset);
+  SprintfLiteral(buf,
+                 "%s: CFI %s at offset 0x%llx in section '%s':"
+                 " the instruction at offset 0x%llx assumes that a CFA rule "
+                 "has been set, but none has been set\n",
+                 filename_.c_str(), CallFrameInfo::KindName(kind), offset,
+                 section_.c_str(), insn_offset);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::EmptyStateStack(uint64 offset,
                                               CallFrameInfo::EntryKind kind,
                                               uint64 insn_offset) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI %s at offset 0x%llx in section '%s':"
-                   " the DW_CFA_restore_state instruction at offset 0x%llx"
-                   " should pop a saved state from the stack, but the stack "
-                   "is empty\n",
-                   filename_.c_str(), CallFrameInfo::KindName(kind), offset,
-                   section_.c_str(), insn_offset);
+  SprintfLiteral(buf,
+                 "%s: CFI %s at offset 0x%llx in section '%s':"
+                 " the DW_CFA_restore_state instruction at offset 0x%llx"
+                 " should pop a saved state from the stack, but the stack "
+                 "is empty\n",
+                 filename_.c_str(), CallFrameInfo::KindName(kind), offset,
+                 section_.c_str(), insn_offset);
   log_(buf);
 }
 
 void CallFrameInfo::Reporter::ClearingCFARule(uint64 offset,
                                               CallFrameInfo::EntryKind kind,
                                               uint64 insn_offset) {
   char buf[300];
-  snprintf_literal(buf,
-                   "%s: CFI %s at offset 0x%llx in section '%s':"
-                   " the DW_CFA_restore_state instruction at offset 0x%llx"
-                   " would clear the CFA rule in effect\n",
-                   filename_.c_str(), CallFrameInfo::KindName(kind), offset,
-                   section_.c_str(), insn_offset);
+  SprintfLiteral(buf,
+                 "%s: CFI %s at offset 0x%llx in section '%s':"
+                 " the DW_CFA_restore_state instruction at offset 0x%llx"
+                 " would clear the CFA rule in effect\n",
+                 filename_.c_str(), CallFrameInfo::KindName(kind), offset,
+                 section_.c_str(), insn_offset);
   log_(buf);
 }
 
 
 unsigned int DwarfCFIToModule::RegisterNames::I386() {
   /*
    8 "$eax", "$ecx", "$edx", "$ebx", "$esp", "$ebp", "$esi", "$edi",
    3 "$eip", "$eflags", "$unused1",
@@ -1861,18 +1861,18 @@ int32_t parseDwarfExpr(Summariser* summ,
                        string expr, bool debug,
                        bool pushCfaAtStart, bool derefAtEnd)
 {
   const char* cursor = expr.c_str();
   const char* end1   = cursor + expr.length();
 
   char buf[100];
   if (debug) {
-    snprintf_literal(buf, "LUL.DW  << DwarfExpr, len is %d\n",
-                     (int)(end1 - cursor));
+    SprintfLiteral(buf, "LUL.DW  << DwarfExpr, len is %d\n",
+                   (int)(end1 - cursor));
     summ->Log(buf);
   }
   
   // Add a marker for the start of this expression.  In it, indicate
   // whether or not the CFA should be pushed onto the stack prior to
   // evaluation.
   int32_t start_ix
     = summ->AddPfxInstr(PfxInstr(PX_Start, pushCfaAtStart ? 1 : 0));
@@ -1886,31 +1886,31 @@ int32_t parseDwarfExpr(Summariser* summ,
     const char* nm   = nullptr;
     PfxExprOp   pxop = PX_End;
     
     switch (opc) {
 
       case DW_OP_lit0 ... DW_OP_lit31: {
         int32_t simm32 = (int32_t)(opc - DW_OP_lit0);
         if (debug) {
-          snprintf_literal(buf, "LUL.DW   DW_OP_lit%d\n", (int)simm32);
+          SprintfLiteral(buf, "LUL.DW   DW_OP_lit%d\n", (int)simm32);
           summ->Log(buf);
         }
         (void) summ->AddPfxInstr(PfxInstr(PX_SImm32, simm32));
         break;
       }
 
       case DW_OP_breg0 ... DW_OP_breg31: {
         size_t len;
         int64_t n = reader->ReadSignedLEB128(cursor, &len);
         cursor += len;
         DW_REG_NUMBER reg = (DW_REG_NUMBER)(opc - DW_OP_breg0);
         if (debug) {
-          snprintf_literal(buf, "LUL.DW   DW_OP_breg%d %lld\n",
-                           (int)reg, (long long int)n);
+          SprintfLiteral(buf, "LUL.DW   DW_OP_breg%d %lld\n",
+                         (int)reg, (long long int)n);
           summ->Log(buf);
         }
         // PfxInstr only allows a 32 bit signed offset.  So we
         // must fail if the immediate is out of range.
         if (n < INT32_MIN || INT32_MAX < n)
           goto fail;
         (void) summ->AddPfxInstr(PfxInstr(PX_DwReg, reg));
         (void) summ->AddPfxInstr(PfxInstr(PX_SImm32, (int32_t)n));
@@ -1921,41 +1921,41 @@ int32_t parseDwarfExpr(Summariser* summ,
       case DW_OP_const4s: {
         uint64_t u64 = reader->ReadFourBytes(cursor);
         cursor += 4;
         // u64 is guaranteed by |ReadFourBytes| to be in the
         // range 0 .. FFFFFFFF inclusive.  But to be safe:
         uint32_t u32 = (uint32_t)(u64 & 0xFFFFFFFF);
         int32_t  s32 = (int32_t)u32;
         if (debug) {
-          snprintf_literal(buf, "LUL.DW   DW_OP_const4s %d\n", (int)s32);
+          SprintfLiteral(buf, "LUL.DW   DW_OP_const4s %d\n", (int)s32);
           summ->Log(buf);
         }
         (void) summ->AddPfxInstr(PfxInstr(PX_SImm32, s32));
         break;
       }
       
       case DW_OP_deref: nm = "deref"; pxop = PX_Deref;  goto no_operands;
       case DW_OP_and:   nm = "and";   pxop = PX_And;    goto no_operands;
       case DW_OP_plus:  nm = "plus";  pxop = PX_Add;    goto no_operands;
       case DW_OP_minus: nm = "minus"; pxop = PX_Sub;    goto no_operands;
       case DW_OP_shl:   nm = "shl";   pxop = PX_Shl;    goto no_operands;
       case DW_OP_ge:    nm = "ge";    pxop = PX_CmpGES; goto no_operands;
       no_operands:
         MOZ_ASSERT(nm && pxop != PX_End);
         if (debug) {
-          snprintf_literal(buf, "LUL.DW   DW_OP_%s\n", nm);
+          SprintfLiteral(buf, "LUL.DW   DW_OP_%s\n", nm);
           summ->Log(buf);
         }
         (void) summ->AddPfxInstr(PfxInstr(pxop));
         break;
 
       default:
         if (debug) {
-          snprintf_literal(buf, "LUL.DW   unknown opc %d\n", (int)opc);
+          SprintfLiteral(buf, "LUL.DW   unknown opc %d\n", (int)opc);
           summ->Log(buf);
         }
         goto fail;
 
     } // switch (opc)
 
   } // while (cursor < end1)
   
@@ -1972,18 +1972,18 @@ int32_t parseDwarfExpr(Summariser* summ,
   // inserted.
   if (derefAtEnd) {
     (void) summ->AddPfxInstr(PfxInstr(PX_Deref));
   }
 
   // Insert an end marker, and declare success.
   (void) summ->AddPfxInstr(PfxInstr(PX_End));
   if (debug) {
-    snprintf_literal(buf, "LUL.DW   conversion of dwarf expression succeeded, "
-                          "ix = %d\n", (int)start_ix);
+    SprintfLiteral(buf, "LUL.DW   conversion of dwarf expression succeeded, "
+                        "ix = %d\n", (int)start_ix);
     summ->Log(buf);
     summ->Log("LUL.DW  >>\n");
   }
   return start_ix;
       
  fail:
   if (debug) {
     summ->Log("LUL.DW   conversion of dwarf expression failed\n");
@@ -1993,18 +1993,18 @@ int32_t parseDwarfExpr(Summariser* summ,
 }
 
 
 bool DwarfCFIToModule::Entry(size_t offset, uint64 address, uint64 length,
                              uint8 version, const string &augmentation,
                              unsigned return_address) {
   if (DEBUG_DWARF) {
     char buf[100];
-    snprintf_literal(buf, "LUL.DW DwarfCFIToModule::Entry 0x%llx,+%lld\n",
-                     address, length);
+    SprintfLiteral(buf, "LUL.DW DwarfCFIToModule::Entry 0x%llx,+%lld\n",
+                   address, length);
     summ_->Log(buf);
   }
   
   summ_->Entry(address, length);
 
   // If dwarf2reader::CallFrameInfo can handle this version and
   // augmentation, then we should be okay with that, so there's no
   // need to check them here.
@@ -2029,69 +2029,69 @@ const UniqueString* DwarfCFIToModule::Re
     MOZ_ASSERT(i == kCFARegister);
     return usu_->ToUniqueString(".cfa");
   }
   unsigned reg = i;
   if (reg == return_address_)
     return usu_->ToUniqueString(".ra");
 
   char buf[30];
-  snprintf_literal(buf, "dwarf_reg_%u", reg);
+  SprintfLiteral(buf, "dwarf_reg_%u", reg);
   return usu_->ToUniqueString(buf);
 }
 
 bool DwarfCFIToModule::UndefinedRule(uint64 address, int reg) {
   reporter_->UndefinedNotSupported(entry_offset_, RegisterName(reg));
   // Treat this as a non-fatal error.
   return true;
 }
 
 bool DwarfCFIToModule::SameValueRule(uint64 address, int reg) {
   if (DEBUG_DWARF) {
     char buf[100];
-    snprintf_literal(buf, "LUL.DW  0x%llx: old r%d = Same\n", address, reg);
+    SprintfLiteral(buf, "LUL.DW  0x%llx: old r%d = Same\n", address, reg);
     summ_->Log(buf);
   }
   // reg + 0
   summ_->Rule(address, reg, NODEREF, reg, 0);
   return true;
 }
 
 bool DwarfCFIToModule::OffsetRule(uint64 address, int reg,
                                   int base_register, long offset) {
   if (DEBUG_DWARF) {
     char buf[100];
-    snprintf_literal(buf, "LUL.DW  0x%llx: old r%d = *(r%d + %ld)\n",
-                     address, reg, base_register, offset);
+    SprintfLiteral(buf, "LUL.DW  0x%llx: old r%d = *(r%d + %ld)\n",
+                   address, reg, base_register, offset);
     summ_->Log(buf);
   }
   // *(base_register + offset)
   summ_->Rule(address, reg, DEREF, base_register, offset);
   return true;
 }
 
 bool DwarfCFIToModule::ValOffsetRule(uint64 address, int reg,
                                      int base_register, long offset) {
   if (DEBUG_DWARF) {
     char buf[100];
-    snprintf_literal(buf, "LUL.DW  0x%llx: old r%d = r%d + %ld\n",
-                     address, reg, base_register, offset);
+    SprintfLiteral(buf, "LUL.DW  0x%llx: old r%d = r%d + %ld\n",
+                   address, reg, base_register, offset);
     summ_->Log(buf);
   }
   // base_register + offset
   summ_->Rule(address, reg, NODEREF, base_register, offset);
   return true;
 }
 
 bool DwarfCFIToModule::RegisterRule(uint64 address, int reg,
                                     int base_register) {
   if (DEBUG_DWARF) {
     char buf[100];
-    snprintf_literal(buf, "LUL.DW  0x%llx: old r%d = r%d\n",
-                     address, reg, base_register);
+    SprintfLiteral(buf, "LUL.DW  0x%llx: old r%d = r%d\n",
+                   address, reg, base_register);
     summ_->Log(buf);
   }
   // base_register + 0
   summ_->Rule(address, reg, NODEREF, base_register, 0);
   return true;
 }
 
 bool DwarfCFIToModule::ExpressionRule(uint64 address, int reg,
@@ -2136,18 +2136,17 @@ bool DwarfCFIToModule::End() {
   summ_->End();
   return true;
 }
 
 void DwarfCFIToModule::Reporter::UndefinedNotSupported(
     size_t offset,
     const UniqueString* reg) {
   char buf[300];
-  snprintf_literal(buf,
-                   "DwarfCFIToModule::Reporter::UndefinedNotSupported()\n");
+  SprintfLiteral(buf, "DwarfCFIToModule::Reporter::UndefinedNotSupported()\n");
   log_(buf);
   //BPLOG(INFO) << file_ << ", section '" << section_
   //  << "': the call frame entry at offset 0x"
   //  << std::setbase(16) << offset << std::setbase(10)
   //  << " sets the rule for register '" << FromUniqueString(reg)
   //  << "' to 'undefined', but the Breakpad symbol file format cannot "
   //  << " express this";
 }
@@ -2166,16 +2165,16 @@ static bool is_power_of_2(uint64_t n)
 void DwarfCFIToModule::Reporter::ExpressionCouldNotBeSummarised(
     size_t offset,
     const UniqueString* reg) {
   static uint64_t n_complaints = 0; // This isn't threadsafe
   n_complaints++;
   if (!is_power_of_2(n_complaints))
     return;
   char buf[300];
-  snprintf_literal(buf,
-                   "DwarfCFIToModule::Reporter::"
-                   "ExpressionCouldNotBeSummarised(shown %llu times)\n",
-                   (unsigned long long int)n_complaints);
+  SprintfLiteral(buf,
+                 "DwarfCFIToModule::Reporter::"
+                 "ExpressionCouldNotBeSummarised(shown %llu times)\n",
+                 (unsigned long long int)n_complaints);
   log_(buf);
 }
 
 } // namespace lul
--- a/tools/profiler/lul/LulDwarfSummariser.cpp
+++ b/tools/profiler/lul/LulDwarfSummariser.cpp
@@ -59,19 +59,20 @@ Summariser::Summariser(SecMap* aSecMap, 
 }
 
 void
 Summariser::Entry(uintptr_t aAddress, uintptr_t aLength)
 {
   aAddress += mTextBias;
   if (DEBUG_SUMMARISER) {
     char buf[100];
-    snprintf_literal(buf, "LUL Entry(%llx, %llu)\n",
-                     (unsigned long long int)aAddress,
-                     (unsigned long long int)aLength);
+    SprintfLiteral(buf,
+                   "LUL Entry(%llx, %llu)\n",
+                   (unsigned long long int)aAddress,
+                   (unsigned long long int)aLength);
     mLog(buf);
   }
   // This throws away any previous summary, that is, assumes
   // that the previous summary, if any, has been properly finished
   // by a call to End().
   mCurrAddr = aAddress;
   mMax1Addr = aAddress + aLength;
   new (&mCurrRules) RuleSet();
@@ -81,30 +82,30 @@ void
 Summariser::Rule(uintptr_t aAddress, int aNewReg,
                  LExprHow how, int16_t oldReg, int64_t offset)
 {
   aAddress += mTextBias;
   if (DEBUG_SUMMARISER) {
     char buf[100];
     if (how == NODEREF || how == DEREF) {
       bool deref = how == DEREF;
-      snprintf_literal(buf,
-                       "LUL  0x%llx  old-r%d = %sr%d + %lld%s\n",
-                       (unsigned long long int)aAddress, aNewReg,
-                       deref ? "*(" : "", (int)oldReg, (long long int)offset,
-                       deref ? ")" : "");
+      SprintfLiteral(buf,
+                     "LUL  0x%llx  old-r%d = %sr%d + %lld%s\n",
+                     (unsigned long long int)aAddress, aNewReg,
+                     deref ? "*(" : "", (int)oldReg, (long long int)offset,
+                     deref ? ")" : "");
     } else if (how == PFXEXPR) {
-      snprintf_literal(buf,
-                       "LUL  0x%llx  old-r%d = pfx-expr-at %lld\n",
-                       (unsigned long long int)aAddress, aNewReg,
-                       (long long int)offset);
+      SprintfLiteral(buf,
+                     "LUL  0x%llx  old-r%d = pfx-expr-at %lld\n",
+                     (unsigned long long int)aAddress, aNewReg,
+                     (long long int)offset);
     } else {
-      snprintf_literal(buf,
-                       "LUL  0x%llx  old-r%d = (invalid LExpr!)\n",
-                       (unsigned long long int)aAddress, aNewReg);
+      SprintfLiteral(buf,
+                     "LUL  0x%llx  old-r%d = (invalid LExpr!)\n",
+                     (unsigned long long int)aAddress, aNewReg);
     }
     mLog(buf);
   }
 
   if (mCurrAddr < aAddress) {
     // Flush the existing summary first.
     mCurrRules.mAddr = mCurrAddr;
     mCurrRules.mLen  = aAddress - mCurrAddr;
@@ -317,22 +318,22 @@ Summariser::Rule(uintptr_t aAddress, int
 # error "Unsupported arch"
 #endif
 
   return;
 
  cant_summarise:
   if (reason1 || reason2) {
     char buf[200];
-    snprintf_literal(buf, "LUL  can't summarise: "
-                     "SVMA=0x%llx: %s%s, expr=LExpr(%s,%u,%lld)\n",
-                     (unsigned long long int)(aAddress - mTextBias),
-                     reason1 ? reason1 : "", reason2 ? reason2 : "",
-                     NameOf_LExprHow(how),
-                     (unsigned int)oldReg, (long long int)offset);
+    SprintfLiteral(buf, "LUL  can't summarise: "
+                        "SVMA=0x%llx: %s%s, expr=LExpr(%s,%u,%lld)\n",
+                   (unsigned long long int)(aAddress - mTextBias),
+                   reason1 ? reason1 : "", reason2 ? reason2 : "",
+                   NameOf_LExprHow(how),
+                   (unsigned int)oldReg, (long long int)offset);
     mLog(buf);
   }
 }
 
 uint32_t
 Summariser::AddPfxInstr(PfxInstr pfxi)
 {
   return mSecMap->AddPfxInstr(pfxi);
--- a/tools/profiler/lul/LulMain.cpp
+++ b/tools/profiler/lul/LulMain.cpp
@@ -80,43 +80,43 @@ LExpr::ShowRule(const char* aNewReg) con
 {
   char buf[64];
   string res = string(aNewReg) + "=";
   switch (mHow) {
     case UNKNOWN:
       res += "Unknown";
       break;
     case NODEREF:
-      snprintf_literal(buf, "%s+%d",
-                       NameOf_DW_REG(mReg), (int)mOffset);
+      SprintfLiteral(buf, "%s+%d",
+                     NameOf_DW_REG(mReg), (int)mOffset);
       res += buf;
       break;
     case DEREF:
-      snprintf_literal(buf, "*(%s+%d)",
-                       NameOf_DW_REG(mReg), (int)mOffset);
+      SprintfLiteral(buf, "*(%s+%d)",
+                     NameOf_DW_REG(mReg), (int)mOffset);
       res += buf;
       break;
     case PFXEXPR:
-      snprintf_literal(buf, "PfxExpr-at-%d", (int)mOffset);
+      SprintfLiteral(buf, "PfxExpr-at-%d", (int)mOffset);
       res += buf;
       break;
     default:
       res += "???";
       break;
   }
   return res;
 }
 
 void
 RuleSet::Print(void(*aLog)(const char*)) const
 {
   char buf[96];
-  snprintf_literal(buf, "[%llx .. %llx]: let ",
-                   (unsigned long long int)mAddr,
-                   (unsigned long long int)(mAddr + mLen - 1));
+  SprintfLiteral(buf, "[%llx .. %llx]: let ",
+                 (unsigned long long int)mAddr,
+                 (unsigned long long int)(mAddr + mLen - 1));
   string res = string(buf);
   res += mCfaExpr.ShowRule("cfa");
   res += " in";
   // For each reg we care about, print the recovery expression.
 #if defined(LUL_ARCH_x64) || defined(LUL_ARCH_x86)
   res += mXipExpr.ShowRule(" RA");
   res += mXspExpr.ShowRule(" SP");
   res += mXbpExpr.ShowRule(" BP");
@@ -340,20 +340,20 @@ SecMap::PrepareRuleSets(uintptr_t aStart
     // Use the values defined in comments in the class declaration.
     mSummaryMinAddr = 1;
     mSummaryMaxAddr = 0;
   } else {
     mSummaryMinAddr = mRuleSets[0].mAddr;
     mSummaryMaxAddr = mRuleSets[n-1].mAddr + mRuleSets[n-1].mLen - 1;
   }
   char buf[150];
-  snprintf_literal(buf,
-                   "PrepareRuleSets: %d entries, smin/smax 0x%llx, 0x%llx\n",
-                   (int)n, (unsigned long long int)mSummaryMinAddr,
-                           (unsigned long long int)mSummaryMaxAddr);
+  SprintfLiteral(buf,
+                 "PrepareRuleSets: %d entries, smin/smax 0x%llx, 0x%llx\n",
+                 (int)n, (unsigned long long int)mSummaryMinAddr,
+                         (unsigned long long int)mSummaryMaxAddr);
   buf[sizeof(buf)-1] = 0;
   mLog(buf);
 
   // Is now usable for binary search.
   mUsable = true;
 
   if (0) {
     mLog("\nRulesets after preening\n");
@@ -548,18 +548,18 @@ class PriMap {
     if (i == num_secMaps) {
       // It goes at the end.
       mSecMaps.push_back(aSecMap);
     } else {
       std::vector<SecMap*>::iterator iter = mSecMaps.begin() + i;
       mSecMaps.insert(iter, aSecMap);
     }
     char buf[100];
-    snprintf_literal(buf, "AddSecMap: now have %d SecMaps\n",
-                     (int)mSecMaps.size());
+    SprintfLiteral(buf, "AddSecMap: now have %d SecMaps\n",
+                   (int)mSecMaps.size());
     buf[sizeof(buf)-1] = 0;
     mLog(buf);
   }
 
   // Remove and delete any SecMaps in the mapping, that intersect
   // with the specified address range.
   void RemoveSecMapsInRange(uintptr_t avma_min, uintptr_t avma_max) {
     MOZ_ASSERT(avma_min <= avma_max);
@@ -821,19 +821,19 @@ class PriMap {
 
 ////////////////////////////////////////////////////////////////
 // LUL                                                        //
 ////////////////////////////////////////////////////////////////
 
 #define LUL_LOG(_str) \
   do { \
     char buf[200]; \
-    snprintf_literal(buf, \
-                     "LUL: pid %d tid %d lul-obj %p: %s", \
-                     getpid(), gettid(), this, (_str)); \
+    SprintfLiteral(buf, \
+                   "LUL: pid %d tid %d lul-obj %p: %s", \
+                   getpid(), gettid(), this, (_str));   \
     buf[sizeof(buf)-1] = 0; \
     mLog(buf); \
   } while (0)
 
 LUL::LUL(void (*aLog)(const char*))
   : mLog(aLog)
   , mAdminMode(true)
   , mAdminThreadId(gettid())
@@ -865,20 +865,20 @@ LUL::MaybeShowStats()
   // But it's just stats printing, so we don't really care.
   uint32_t n_new = mStats - mStatsPrevious;
   if (n_new >= 5000) {
     uint32_t n_new_Context = mStats.mContext - mStatsPrevious.mContext;
     uint32_t n_new_CFI     = mStats.mCFI     - mStatsPrevious.mCFI;
     uint32_t n_new_Scanned = mStats.mScanned - mStatsPrevious.mScanned;
     mStatsPrevious = mStats;
     char buf[200];
-    snprintf_literal(buf,
-                     "LUL frame stats: TOTAL %5u"
-                     "    CTX %4u    CFI %4u    SCAN %4u",
-                     n_new, n_new_Context, n_new_CFI, n_new_Scanned);
+    SprintfLiteral(buf,
+                   "LUL frame stats: TOTAL %5u"
+                   "    CTX %4u    CFI %4u    SCAN %4u",
+                   n_new, n_new_Context, n_new_CFI, n_new_Scanned);
     buf[sizeof(buf)-1] = 0;
     mLog(buf);
   }
 }
 
 
 void
 LUL::EnableUnwinding()
@@ -896,19 +896,19 @@ void
 LUL::NotifyAfterMap(uintptr_t aRXavma, size_t aSize,
                     const char* aFileName, const void* aMappedImage)
 {
   MOZ_ASSERT(mAdminMode);
   MOZ_ASSERT(gettid() == mAdminThreadId);
 
   mLog(":\n");
   char buf[200];
-  snprintf_literal(buf, "NotifyMap %llx %llu %s\n",
-                   (unsigned long long int)aRXavma, (unsigned long long int)aSize,
-                   aFileName);
+  SprintfLiteral(buf, "NotifyMap %llx %llu %s\n",
+                 (unsigned long long int)aRXavma, (unsigned long long int)aSize,
+                 aFileName);
   buf[sizeof(buf)-1] = 0;
   mLog(buf);
 
   // Ignore obviously-stupid notifications.
   if (aSize > 0) {
 
     // Here's a new mapping, for this object.
     SecMap* smap = new SecMap(mLog);
@@ -924,18 +924,18 @@ LUL::NotifyAfterMap(uintptr_t aRXavma, s
               string(aFileName), std::vector<string>(), smap,
               (void*)aRXavma, aSize, mUSU, mLog);
     }
 
     mLog("NotifyMap .. preparing entries\n");
 
     smap->PrepareRuleSets(aRXavma, aSize);
 
-    snprintf_literal(buf,
-                     "NotifyMap got %lld entries\n", (long long int)smap->Size());
+    SprintfLiteral(buf,
+                   "NotifyMap got %lld entries\n", (long long int)smap->Size());
     buf[sizeof(buf)-1] = 0;
     mLog(buf);
 
     // Add it to the primary map (the top level set of mapped objects).
     mPriMap->AddSecMap(smap);
 
     // Tell the segment array about the mapping, so that the stack
     // scan and __kernel_syscall mechanisms know where valid code is.
@@ -947,17 +947,17 @@ LUL::NotifyAfterMap(uintptr_t aRXavma, s
 void
 LUL::NotifyExecutableArea(uintptr_t aRXavma, size_t aSize)
 {
   MOZ_ASSERT(mAdminMode);
   MOZ_ASSERT(gettid() == mAdminThreadId);
 
   mLog(":\n");
   char buf[200];
-  snprintf_literal(buf, "NotifyExecutableArea %llx %llu\n",
+  SprintfLiteral(buf, "NotifyExecutableArea %llx %llu\n",
                    (unsigned long long int)aRXavma, (unsigned long long int)aSize);
   buf[sizeof(buf)-1] = 0;
   mLog(buf);
 
   // Ignore obviously-stupid notifications.
   if (aSize > 0) {
     // Tell the segment array about the mapping, so that the stack
     // scan and __kernel_syscall mechanisms know where valid code is.
@@ -969,34 +969,34 @@ LUL::NotifyExecutableArea(uintptr_t aRXa
 void
 LUL::NotifyBeforeUnmap(uintptr_t aRXavmaMin, uintptr_t aRXavmaMax)
 {
   MOZ_ASSERT(mAdminMode);
   MOZ_ASSERT(gettid() == mAdminThreadId);
 
   mLog(":\n");
   char buf[100];
-  snprintf_literal(buf, "NotifyUnmap %016llx-%016llx\n",
-                   (unsigned long long int)aRXavmaMin,
-                   (unsigned long long int)aRXavmaMax);
+  SprintfLiteral(buf, "NotifyUnmap %016llx-%016llx\n",
+                 (unsigned long long int)aRXavmaMin,
+                 (unsigned long long int)aRXavmaMax);
   buf[sizeof(buf)-1] = 0;
   mLog(buf);
 
   MOZ_ASSERT(aRXavmaMin <= aRXavmaMax);
 
   // Remove from the primary map, any secondary maps that intersect
   // with the address range.  Also delete the secondary maps.
   mPriMap->RemoveSecMapsInRange(aRXavmaMin, aRXavmaMax);
 
   // Tell the segment array that the address range no longer
   // contains valid code.
   mSegArray->add(aRXavmaMin, aRXavmaMax, false);
 
-  snprintf_literal(buf, "NotifyUnmap: now have %d SecMaps\n",
-                   (int)mPriMap->CountSecMaps());
+  SprintfLiteral(buf, "NotifyUnmap: now have %d SecMaps\n",
+                 (int)mPriMap->CountSecMaps());
   buf[sizeof(buf)-1] = 0;
   mLog(buf);
 }
 
 
 size_t
 LUL::CountMappings()
 {
@@ -1305,33 +1305,33 @@ LUL::Unwind(/*OUT*/uintptr_t* aFramePCs,
   static const int NUM_SCANNED_WORDS = 50; // max allowed scan length
 
   while (true) {
 
     if (DEBUG_MAIN) {
       char buf[300];
       mLog("\n");
 #if defined(LUL_ARCH_x64) || defined(LUL_ARCH_x86)
-      snprintf_literal(buf,
-                       "LoopTop: rip %d/%llx  rsp %d/%llx  rbp %d/%llx\n",
-                       (int)regs.xip.Valid(), (unsigned long long int)regs.xip.Value(),
-                       (int)regs.xsp.Valid(), (unsigned long long int)regs.xsp.Value(),
-                       (int)regs.xbp.Valid(), (unsigned long long int)regs.xbp.Value());
+      SprintfLiteral(buf,
+                     "LoopTop: rip %d/%llx  rsp %d/%llx  rbp %d/%llx\n",
+                     (int)regs.xip.Valid(), (unsigned long long int)regs.xip.Value(),
+                     (int)regs.xsp.Valid(), (unsigned long long int)regs.xsp.Value(),
+                     (int)regs.xbp.Valid(), (unsigned long long int)regs.xbp.Value());
       buf[sizeof(buf)-1] = 0;
       mLog(buf);
 #elif defined(LUL_ARCH_arm)
-      snprintf_literal(buf,
-                       "LoopTop: r15 %d/%llx  r7 %d/%llx  r11 %d/%llx"
-                       "  r12 %d/%llx  r13 %d/%llx  r14 %d/%llx\n",
-                       (int)regs.r15.Valid(), (unsigned long long int)regs.r15.Value(),
-                       (int)regs.r7.Valid(),  (unsigned long long int)regs.r7.Value(),
-                       (int)regs.r11.Valid(), (unsigned long long int)regs.r11.Value(),
-                       (int)regs.r12.Valid(), (unsigned long long int)regs.r12.Value(),
-                       (int)regs.r13.Valid(), (unsigned long long int)regs.r13.Value(),
-                       (int)regs.r14.Valid(), (unsigned long long int)regs.r14.Value());
+      SprintfLiteral(buf,
+                     "LoopTop: r15 %d/%llx  r7 %d/%llx  r11 %d/%llx"
+                     "  r12 %d/%llx  r13 %d/%llx  r14 %d/%llx\n",
+                     (int)regs.r15.Valid(), (unsigned long long int)regs.r15.Value(),
+                     (int)regs.r7.Valid(),  (unsigned long long int)regs.r7.Value(),
+                     (int)regs.r11.Valid(), (unsigned long long int)regs.r11.Value(),
+                     (int)regs.r12.Valid(), (unsigned long long int)regs.r12.Value(),
+                     (int)regs.r13.Valid(), (unsigned long long int)regs.r13.Value(),
+                     (int)regs.r14.Valid(), (unsigned long long int)regs.r14.Value());
       buf[sizeof(buf)-1] = 0;
       mLog(buf);
 #else
 # error "Unsupported arch"
 #endif
     }
 
 #if defined(LUL_ARCH_x64) || defined(LUL_ARCH_x86)
@@ -1390,18 +1390,18 @@ LUL::Unwind(/*OUT*/uintptr_t* aFramePCs,
 
     pair<const RuleSet*, const vector<PfxInstr>*> ruleset_and_pfxinstrs
       = mPriMap->Lookup(ia.Value());
     const RuleSet* ruleset = ruleset_and_pfxinstrs.first;
     const vector<PfxInstr>* pfxinstrs = ruleset_and_pfxinstrs.second;
 
     if (DEBUG_MAIN) {
       char buf[100];
-      snprintf_literal(buf, "ruleset for 0x%llx = %p\n",
-                       (unsigned long long int)ia.Value(), ruleset);
+      SprintfLiteral(buf, "ruleset for 0x%llx = %p\n",
+                     (unsigned long long int)ia.Value(), ruleset);
       buf[sizeof(buf)-1] = 0;
       mLog(buf);
     }
 
     /////////////////////////////////////////////
     ////
     // On 32 bit x86-linux, syscalls are often done via the VDSO
     // function __kernel_vsyscall, which doesn't have a corresponding
@@ -1786,23 +1786,23 @@ bool GetAndCheckStackTrace(LUL* aLUL, co
     nConsistent++;
   }
 
   // So, did we succeed?
   bool passed = nConsistent+1 == strlen(dstring);
 
   // Show the results.
   char buf[200];
-  snprintf_literal(buf, "LULUnitTest:   dstring = %s\n", dstring);
+  SprintfLiteral(buf, "LULUnitTest:   dstring = %s\n", dstring);
   buf[sizeof(buf)-1] = 0;
   aLUL->mLog(buf);
-  snprintf_literal(buf,
-                   "LULUnitTest:     %d consistent, %d in dstring: %s\n",
-                   (int)nConsistent, (int)strlen(dstring),
-                   passed ? "PASS" : "FAIL");
+  SprintfLiteral(buf,
+                 "LULUnitTest:     %d consistent, %d in dstring: %s\n",
+                 (int)nConsistent, (int)strlen(dstring),
+                 passed ? "PASS" : "FAIL");
   buf[sizeof(buf)-1] = 0;
   aLUL->mLog(buf);
 
   return passed;
 }
 
 
 // Macro magic to create a set of 8 mutually recursive functions with
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -3120,17 +3120,17 @@ case _value: eventName.AssignLiteral(_na
     _ASSIGN_eventName(eXULCommandUpdate, "eXULCommandUpdate");
 
 #undef _ASSIGN_eventName
 
   default:
     {
       char buf[32];
 
-      snprintf_literal(buf,"UNKNOWN: %d",aGuiEvent->mMessage);
+      SprintfLiteral(buf,"UNKNOWN: %d",aGuiEvent->mMessage);
 
       CopyASCIItoUTF16(buf, eventName);
     }
     break;
   }
 
   return nsAutoString(eventName);
 }
--- a/widget/xremoteclient/XRemoteClient.cpp
+++ b/widget/xremoteclient/XRemoteClient.cpp
@@ -288,17 +288,17 @@ XRemoteClient::GetLock(Window aWindow, b
   *aDestroyed = false;
 
   nsresult rv = NS_OK;
 
   if (!mLockData) {
     
     char pidstr[32];
     char sysinfobuf[SYS_INFO_BUFFER_LENGTH];
-    snprintf_literal(pidstr, "pid%d@", getpid());
+    SprintfLiteral(pidstr, "pid%d@", getpid());
     PRStatus status;
     status = PR_GetSystemInfo(PR_SI_HOSTNAME, sysinfobuf,
 			      SYS_INFO_BUFFER_LENGTH);
     if (status != PR_SUCCESS) {
       return NS_ERROR_FAILURE;
     }
     
     // allocate enough space for the string plus the terminating
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -604,25 +604,25 @@ CycleCollectedJSRuntime::DescribeGCThing
     } else if (js::IsFunctionObject(obj)) {
       JSFunction* fun = JS_GetObjectFunction(obj);
       JSString* str = JS_GetFunctionDisplayId(fun);
       if (str) {
         JSFlatString* flat = JS_ASSERT_STRING_IS_FLAT(str);
         nsAutoString chars;
         AssignJSFlatString(chars, flat);
         NS_ConvertUTF16toUTF8 fname(chars);
-        snprintf_literal(name, "JS Object (Function - %s)", fname.get());
+        SprintfLiteral(name, "JS Object (Function - %s)", fname.get());
       } else {
-        snprintf_literal(name, "JS Object (Function)");
+        SprintfLiteral(name, "JS Object (Function)");
       }
     } else {
-      snprintf_literal(name, "JS Object (%s)", clasp->name);
+      SprintfLiteral(name, "JS Object (%s)", clasp->name);
     }
   } else {
-    snprintf_literal(name, "JS %s", JS::GCTraceKindToAscii(aThing.kind()));
+    SprintfLiteral(name, "JS %s", JS::GCTraceKindToAscii(aThing.kind()));
   }
 
   // Disable printing global for objects while we figure out ObjShrink fallout.
   aCb.DescribeGCedNode(aIsMarked, name, compartmentAddress);
 }
 
 void
 CycleCollectedJSRuntime::NoteGCThingJSChildren(JS::GCCellPtr aThing,
--- a/xpcom/base/Logging.cpp
+++ b/xpcom/base/Logging.cpp
@@ -216,20 +216,20 @@ public:
       logFile = PR_GetEnv("NSPR_LOG_FILE");
     }
 
     if (logFile && logFile[0]) {
       static const char kPIDToken[] = "%PID";
       const char* pidTokenPtr = strstr(logFile, kPIDToken);
       char buf[2048];
       if (pidTokenPtr &&
-          snprintf_literal(buf, "%.*s%d%s",
-            static_cast<int>(pidTokenPtr - logFile), logFile,
-            detail::log_pid(),
-            pidTokenPtr + strlen(kPIDToken)) > 0)
+          SprintfLiteral(buf, "%.*s%d%s",
+                         static_cast<int>(pidTokenPtr - logFile), logFile,
+                         detail::log_pid(),
+                         pidTokenPtr + strlen(kPIDToken)) > 0)
       {
         logFile = buf;
       }
 
       mOutFilePath.reset(strdup(logFile));
 
       if (mRotate > 0) {
         // Delete all the previously captured files, including non-rotated
@@ -247,17 +247,17 @@ public:
   }
 
   detail::LogFile* OpenFile(bool aShouldAppend, uint32_t aFileNum)
   {
     FILE* file;
 
     if (mRotate > 0) {
       char buf[2048];
-      snprintf_literal(buf, "%s.%d", mOutFilePath.get(), aFileNum);
+      SprintfLiteral(buf, "%s.%d", mOutFilePath.get(), aFileNum);
 
       // rotate doesn't support append.
       file = fopen(buf, "w");
     } else {
       file = fopen(mOutFilePath.get(), aShouldAppend ? "a" : "w");
     }
 
     if (!file) {
@@ -265,17 +265,17 @@ public:
     }
 
     return new detail::LogFile(file, aFileNum);
   }
 
   void RemoveFile(uint32_t aFileNum)
   {
     char buf[2048];
-    snprintf_literal(buf, "%s.%d", mOutFilePath.get(), aFileNum);
+    SprintfLiteral(buf, "%s.%d", mOutFilePath.get(), aFileNum);
     remove(buf);
   }
 
   LogModule* CreateOrGetModule(const char* aName)
   {
     OffTheBooksMutexAutoLock guard(mModulesLock);
     LogModule* module = nullptr;
     if (!mModules.Get(aName, &module)) {
@@ -332,17 +332,17 @@ public:
     // and the module name.
     PRThread *currentThread = PR_GetCurrentThread();
     const char *currentThreadName = (mMainThread == currentThread)
       ? "Main Thread"
       : PR_GetThreadName(currentThread);
 
     char noNameThread[40];
     if (!currentThreadName) {
-      snprintf_literal(noNameThread, "Unnamed thread %p", currentThread);
+      SprintfLiteral(noNameThread, "Unnamed thread %p", currentThread);
       currentThreadName = noNameThread;
     }
 
     if (!mAddTimestamp) {
       fprintf_stderr(out,
                      "[%s]: %s/%s %s%s",
                      currentThreadName, ToLogStr(aLevel),
                      aName, buffToWrite, newline);
--- a/xpcom/ds/nsSupportsPrimitives.cpp
+++ b/xpcom/ds/nsSupportsPrimitives.cpp
@@ -13,17 +13,17 @@
 
 template<typename T>
 static char*
 DataToString(const char* aFormat, T aData)
 {
   static const int size = 32;
   char buf[size];
 
-  int len = snprintf_literal(buf, aFormat, aData);
+  int len = SprintfLiteral(buf, aFormat, aData);
   MOZ_ASSERT(len >= 0);
 
   return static_cast<char*>(nsMemory::Clone(buf, std::min(len + 1, size) *
                                                  sizeof(char)));
 }
 
 /***************************************************************************/
 
--- a/xpcom/glue/nsID.cpp
+++ b/xpcom/glue/nsID.cpp
@@ -118,16 +118,16 @@ nsID::ToString() const
              (uint32_t)m3[6], (uint32_t)m3[7]);
   }
   return res;
 }
 
 void
 nsID::ToProvidedString(char (&aDest)[NSID_LENGTH]) const
 {
-  snprintf_literal(aDest, gIDFormat,
-                   m0, (uint32_t)m1, (uint32_t)m2,
-                   (uint32_t)m3[0], (uint32_t)m3[1], (uint32_t)m3[2],
-                   (uint32_t)m3[3], (uint32_t)m3[4], (uint32_t)m3[5],
-                   (uint32_t)m3[6], (uint32_t)m3[7]);
+  SprintfLiteral(aDest, gIDFormat,
+                 m0, (uint32_t)m1, (uint32_t)m2,
+                 (uint32_t)m3[0], (uint32_t)m3[1], (uint32_t)m3[2],
+                 (uint32_t)m3[3], (uint32_t)m3[4], (uint32_t)m3[5],
+                 (uint32_t)m3[6], (uint32_t)m3[7]);
 }
 
 #endif // XPCOM_GLUE_AVOID_NSPR
--- a/xpcom/threads/ThreadStackHelper.cpp
+++ b/xpcom/threads/ThreadStackHelper.cpp
@@ -459,17 +459,17 @@ ThreadStackHelper::AppendJSEntry(const v
       basename = basename ? basename + 1 : filename;
       // Look for Windows path separator as well.
       filename = strrchr(basename, '\\');
       if (filename) {
         basename = filename + 1;
       }
     }
 
-    size_t len = snprintf_literal(buffer, "%s:%u", basename, lineno);
+    size_t len = SprintfLiteral(buffer, "%s:%u", basename, lineno);
     if (len < sizeof(buffer)) {
       if (mStackToFill->IsSameAsEntry(aPrevLabel, buffer)) {
         return aPrevLabel;
       }
 
       // Keep track of the required buffer size
       aAvailableBufferSize -= (len + 1);
       if (aAvailableBufferSize >= 0) {
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -1596,44 +1596,44 @@ NS_IMETHODIMP nsXULWindow::SavePersisten
     docShellElement->GetId(windowElementId);
   }
 
   bool shouldPersist = !isFullscreen && ownerXULDoc;
   ErrorResult rv;
   // (only for size elements which are persisted)
   if ((mPersistentAttributesDirty & PAD_POSITION) && gotRestoredBounds) {
     if (persistString.Find("screenX") >= 0) {
-      snprintf_literal(sizeBuf, "%d", NSToIntRound(rect.x / posScale.scale));
+      SprintfLiteral(sizeBuf, "%d", NSToIntRound(rect.x / posScale.scale));
       sizeString.AssignWithConversion(sizeBuf);
       docShellElement->SetAttribute(SCREENX_ATTRIBUTE, sizeString, rv);
       if (shouldPersist) {
         ownerXULDoc->Persist(windowElementId, SCREENX_ATTRIBUTE);
       }
     }
     if (persistString.Find("screenY") >= 0) {
-      snprintf_literal(sizeBuf, "%d", NSToIntRound(rect.y / posScale.scale));
+      SprintfLiteral(sizeBuf, "%d", NSToIntRound(rect.y / posScale.scale));
       sizeString.AssignWithConversion(sizeBuf);
       docShellElement->SetAttribute(SCREENY_ATTRIBUTE, sizeString, rv);
       if (shouldPersist) {
         ownerXULDoc->Persist(windowElementId, SCREENY_ATTRIBUTE);
       }
     }
   }
 
   if ((mPersistentAttributesDirty & PAD_SIZE) && gotRestoredBounds) {
     if (persistString.Find("width") >= 0) {
-      snprintf_literal(sizeBuf, "%d", NSToIntRound(rect.width / sizeScale.scale));
+      SprintfLiteral(sizeBuf, "%d", NSToIntRound(rect.width / sizeScale.scale));
       sizeString.AssignWithConversion(sizeBuf);
       docShellElement->SetAttribute(WIDTH_ATTRIBUTE, sizeString, rv);
       if (shouldPersist) {
         ownerXULDoc->Persist(windowElementId, WIDTH_ATTRIBUTE);
       }
     }
     if (persistString.Find("height") >= 0) {
-      snprintf_literal(sizeBuf, "%d", NSToIntRound(rect.height / sizeScale.scale));
+      SprintfLiteral(sizeBuf, "%d", NSToIntRound(rect.height / sizeScale.scale));
       sizeString.AssignWithConversion(sizeBuf);
       docShellElement->SetAttribute(HEIGHT_ATTRIBUTE, sizeString, rv);
       if (shouldPersist) {
         ownerXULDoc->Persist(windowElementId, HEIGHT_ATTRIBUTE);
       }
     }
   }
 
@@ -1652,17 +1652,17 @@ NS_IMETHODIMP nsXULWindow::SavePersisten
         ownerXULDoc->Persist(windowElementId, MODE_ATTRIBUTE);
       }
     }
     if (persistString.Find("zlevel") >= 0) {
       uint32_t zLevel;
       nsCOMPtr<nsIWindowMediator> mediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));
       if (mediator) {
         mediator->GetZLevel(this, &zLevel);
-        snprintf_literal(sizeBuf, "%" PRIu32, zLevel);
+        SprintfLiteral(sizeBuf, "%" PRIu32, zLevel);
         sizeString.AssignWithConversion(sizeBuf);
         docShellElement->SetAttribute(ZLEVEL_ATTRIBUTE, sizeString, rv);
         if (shouldPersist) {
           ownerXULDoc->Persist(windowElementId, ZLEVEL_ATTRIBUTE);
         }
       }
     }
   }