Zero buffer in wgtprintf properly

This commit is contained in:
Adam Greenwood-Byrne 2021-04-19 18:30:07 +01:00
parent 1d0e1717b3
commit 6be60a6de4

View file

@ -428,12 +428,16 @@ number:
void void
wgtprintf (short x, short y, wgtfont font, const char *fmt, ...) wgtprintf (short x, short y, wgtfont font, const char *fmt, ...)
{ {
char *buffer = malloc(250); /* Buffer to build string into*/
memset(buffer, 0, 250);
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
char buffer[251]; /* Buffer to build string into*/
kvprintf(fmt, NULL, (void *)buffer, 10, ap); kvprintf(fmt, NULL, (void *)buffer, 10, ap);
wouttextxy (x, y, font, buffer); wouttextxy (x, y, font, buffer);
va_end(ap); va_end(ap);
free(buffer);
} }