Floss Finder: Igor

Igor is a dentist with more on his "plate" than he can handle
Watch as Igor tries to find all the floss in his patients' mouths
Starring Timmy the Tooth, and the Tooth Fairy; join all your favorite
oral hygiene friends in helping Igor solve his terrible tooth travesty!

(May contain traces of knockoff pokemon, talk to your dietician before consumption)
This commit is contained in:
Lirusaito
2019-02-20 21:22:24 -05:00
parent 9f2d8e6fff
commit a2701faa2b

View File

@@ -41,13 +41,17 @@
// wrapper for vsnprintf to be called from llformatXXX functions.
static void va_format(std::string& out, const char *fmt, va_list va)
{
char tstr[1024]; /* Flawfinder: ignore */
#if LL_WINDOWS
_vsnprintf(tstr, 1024, fmt, va);
#else
vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */
#endif
out.assign(tstr);
constexpr auto smallsize = 1024;
std::vector<char> charvector(smallsize); // Evolves into charveleon
va_list va2;
va_copy(va2, va);
const auto size = std::vsnprintf(charvector.data(), charvector.size(), fmt, va);
if (size >= smallsize)
{
charvector.resize(1+size); // Use the String Stone
std::vsnprintf(charvector.data(), charvector.size(), fmt, va2);
}
out.assign(charvector.data());
}
std::string llformat(const char *fmt, ...)