From eca5e62b09b7113eb234b31301ba97553224ebc2 Mon Sep 17 00:00:00 2001 From: Drake Arconis <drake@alchemyviewer.org> Date: Sat, 25 Jul 2015 15:17:22 -0400 Subject: [PATCH] Clean out old snprintf hack --- indra/llcommon/llstring.cpp | 16 ---------------- indra/llcommon/llstring.h | 27 --------------------------- 2 files changed, 43 deletions(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 99442d4fe2..f4f1568562 100755 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -630,22 +630,6 @@ std::string utf8str_removeCRLF(const std::string& utf8str) } #if LL_WINDOWS -// documentation moved to header. Phoenix 2007-11-27 -namespace snprintf_hack -{ - int snprintf(char *str, size_t size, const char *format, ...) - { - va_list args; - va_start(args, format); - - int num_written = _vsnprintf(str, size, format, args); /* Flawfinder: ignore */ - va_end(args); - - str[size-1] = '\0'; // always null terminate - return num_written; - } -} - std::string ll_convert_wide_to_string(const wchar_t* in, unsigned int code_page) { std::string out; diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 3bbdcae708..900329facc 100755 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -589,33 +589,6 @@ LL_COMMON_API std::string utf8str_removeCRLF(const std::string& utf8str); */ //@{ -/** - * @brief Implementation the expected snprintf interface. - * - * If the size of the passed in buffer is not large enough to hold the string, - * two bad things happen: - * 1. resulting formatted string is NOT null terminated - * 2. Depending on the platform, the return value could be a) the required - * size of the buffer to copy the entire formatted string or b) -1. - * On Windows with VS.Net 2003, it returns -1 e.g. - * - * safe_snprintf always adds a NULL terminator so that the caller does not - * need to check for return value or need to add the NULL terminator. - * It does not, however change the return value - to let the caller know - * that the passed in buffer size was not large enough to hold the - * formatted string. - * - */ -#if _MSC_VER <= 1800 -// Deal with the differeneces on Windows -namespace snprintf_hack -{ - LL_COMMON_API int snprintf(char *str, size_t size, const char *format, ...); -} - -using snprintf_hack::snprintf; -#endif - /** * @brief Convert a wide string to std::string * -- GitLab