From fbbdd62efda9f6fa45c691cafa9b8203ded999a7 Mon Sep 17 00:00:00 2001
From: Cinder <cinder@sdf.org>
Date: Tue, 26 Jan 2016 20:53:02 -0700
Subject: [PATCH] Use std::vnsprintf for llformat

---
 indra/llcommon/llformat.cpp           | 6 ++----
 indra/newview/lleasymessagereader.cpp | 3 ++-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp
index 345d3a4feb..10508d28e0 100755
--- a/indra/llcommon/llformat.cpp
+++ b/indra/llcommon/llformat.cpp
@@ -29,14 +29,12 @@
 
 #include "llformat.h"
 
-#include <cstdarg>
-
 // common used function with va_list argument
 // wrapper for vsnprintf to be called from llformatXXX functions.
 static void va_format(std::string& out, const char *fmt, va_list va)
 {
-	char tstr[8096];	/* Flawfinder: ignore */
-	vsnprintf(tstr, 8096, fmt, va);	/* Flawfinder: ignore */
+	char tstr[2048];	/* Flawfinder: ignore */
+	std::vsnprintf(tstr, 2048, fmt, va);	/* Flawfinder: ignore */
 	out.assign(tstr);
 }
 
diff --git a/indra/newview/lleasymessagereader.cpp b/indra/newview/lleasymessagereader.cpp
index 1d616d0c84..3635dae3bf 100644
--- a/indra/newview/lleasymessagereader.cpp
+++ b/indra/newview/lleasymessagereader.cpp
@@ -28,6 +28,7 @@
 #include <libxml/HTMLtree.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/predicate.hpp>
+#include <boost/format.hpp>
 
 //I doubt any of this is thread safe!
 LLEasyMessageLogEntry::LLEasyMessageLogEntry(LogPayload entry, LLEasyMessageReader* message_reader)
@@ -130,7 +131,7 @@ std::string LLEasyMessageLogEntry::getFull(BOOL beautify, BOOL show_header)
 			if(temp)
 			{
 				full << (isOutgoing() ? "out " : "in ");
-				full << llformat("%s\n\n", temp->mName);
+				full << (boost::format("%s\n\n") % temp->mName);
 				if(show_header)
 				{
 					full << "[Header]\n";
-- 
GitLab