Skip to content

Commit 2aeac3c

Browse files
authored
Merge branch 'main' into xmagic_file
2 parents 44e6bc6 + e702dd9 commit 2aeac3c

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/xinterpreter.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -340,29 +340,6 @@ __get_cxx_version ()
340340
restore_output();
341341
}
342342

343-
static std::string c_format(const char* format, std::va_list args)
344-
{
345-
// Call vsnprintf once to determine the required buffer length. The
346-
// return value is the number of characters _excluding_ the null byte.
347-
std::va_list args_bufsz;
348-
va_copy(args_bufsz, args);
349-
std::size_t bufsz = vsnprintf(NULL, 0, format, args_bufsz);
350-
va_end(args_bufsz);
351-
352-
// Create an empty string of that size.
353-
std::string s(bufsz, 0);
354-
355-
// Now format the data into this string and return it.
356-
std::va_list args_format;
357-
va_copy(args_format, args);
358-
// The second parameter is the maximum number of bytes that vsnprintf
359-
// will write _including_ the terminating null byte.
360-
vsnprintf(&s[0], s.size() + 1, format, args_format);
361-
va_end(args_format);
362-
363-
return s;
364-
}
365-
366343
void interpreter::redirect_output()
367344
{
368345
p_cout_strbuf = std::cout.rdbuf();

0 commit comments

Comments
 (0)