summaryrefslogtreecommitdiff
path: root/indra/llcommon/llformat.cpp
diff options
context:
space:
mode:
authorMark Lentczner <markl@lindenlab.com>2007-02-06 00:57:33 +0000
committerMark Lentczner <markl@lindenlab.com>2007-02-06 00:57:33 +0000
commitd0d4670f4941dcf7430fb1269c6613140ecf3ff7 (patch)
treee3d6b59c19cac6bc172ec5fb0131ffc8f4923b75 /indra/llcommon/llformat.cpp
parent77f04c74eb1603bf2fadc30127d05378bfc7a48a (diff)
merge in of error-refactor-3
concludes (fixes) SL-31187 pair programmed and reviewed by markl and karen
Diffstat (limited to 'indra/llcommon/llformat.cpp')
-rw-r--r--indra/llcommon/llformat.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp
new file mode 100644
index 0000000000..0c2a6d3b1e
--- /dev/null
+++ b/indra/llcommon/llformat.cpp
@@ -0,0 +1,28 @@
+/**
+ * @file llformat.cpp
+ * @date January 2007
+ * @brief string formatting utility
+ *
+ * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
+ * $License$
+ */
+
+#include "linden_common.h"
+
+#include "llformat.h"
+
+#include <stdarg.h>
+
+std::string llformat(const char *fmt, ...)
+{
+ char tstr[1024]; /* Flawfinder: ignore */
+ va_list va;
+ va_start(va, fmt);
+#if LL_WINDOWS
+ _vsnprintf(tstr, 1024, fmt, va);
+#else
+ vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */
+#endif
+ va_end(va);
+ return std::string(tstr);
+}