Unverified Commit 2d4654a1 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

prefer 'vsnprintf' to 'vsprintf' (#5561)

parent 61ef3ada
......@@ -109,12 +109,13 @@ class Log {
}
static void Fatal(const char *format, ...) {
va_list val;
char str_buf[1024];
const size_t kBufSize = 1024;
char str_buf[kBufSize];
va_start(val, format);
#ifdef _MSC_VER
vsprintf_s(str_buf, format, val);
vsnprintf_s(str_buf, kBufSize, format, val);
#else
vsprintf(str_buf, format, val);
vsnprintf(str_buf, kBufSize, format, val);
#endif
va_end(val);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment