This commit is contained in:
twinaphex 2020-06-26 20:56:58 +02:00
parent 21dd3538d4
commit ae9d313e48
2 changed files with 4 additions and 2 deletions

View file

@ -443,7 +443,8 @@ int filestream_putc(RFILE *stream, int c)
int filestream_vprintf(RFILE *stream, const char* format, va_list args)
{
static char buffer[8 * 1024];
int64_t num_chars = vsprintf(buffer, format, args);
int64_t num_chars = vsnprintf(buffer, sizeof(buffer),
format, args);
if (num_chars < 0)
return -1;

View file

@ -840,7 +840,8 @@ int rzipstream_putc(rzipstream_t *stream, int c)
int rzipstream_vprintf(rzipstream_t *stream, const char* format, va_list args)
{
static char buffer[8 * 1024] = {0};
int64_t num_chars = vsprintf(buffer, format, args);
int64_t num_chars = vsnprintf(buffer,
sizeof(buffer), format, args);
if (num_chars < 0)
return -1;