more vsnprintf

This commit is contained in:
nhmall
2020-01-20 19:22:18 -05:00
parent d61bfc98b4
commit 775519f851
2 changed files with 8 additions and 24 deletions

View File

@@ -1155,7 +1155,7 @@ VA_DECL(const char *, s)
if (iflags.window_inited)
end_screen();
buf[0] = '\n';
(void) vsprintf(&buf[1], s, VA_ARGS);
(void) vsnprintf(&buf[1], sizeof buf - 1, s, VA_ARGS);
msmsg(buf);
really_move_cursor();
VA_END();
@@ -1973,7 +1973,7 @@ VA_DECL(const char *, fmt)
char buf[ROWNO * COLNO]; /* worst case scenario */
VA_START(fmt);
VA_INIT(fmt, const char *);
Vsprintf(buf, fmt, VA_ARGS);
(void) vsnprintf(buf, sizeof buf, fmt, VA_ARGS);
if (redirect_stdout)
fprintf(stdout, "%s", buf);
else {