diff --git a/src/dialogue.c b/src/dialogue.c index 84900aa..8743b5a 100644 --- a/src/dialogue.c +++ b/src/dialogue.c @@ -61,7 +61,7 @@ void dialogue_alert(const char* fmt, ...) { if(fmt == NULL) return; else { /* Get the message. */ va_start(ap, fmt); - vsprintf(msg, fmt, ap); + vsnprintf(msg, 512, fmt, ap); va_end(ap); } @@ -142,7 +142,7 @@ void dialogue_msg(char* caption, const char* fmt, ...) { if(fmt == NULL) return; else { va_start(ap, fmt); - vsprintf(msg, fmt, ap); + vsnprintf(msg, 4096, fmt, ap); va_end(ap); } @@ -185,7 +185,7 @@ int dialogue_YesNo(char* caption, const char* fmt, ...) { if(fmt == NULL) return -1; else { /* Get the message. */ va_start(ap, fmt); - vsprintf(msg, fmt, ap); + vsnprintf(msg, 4096, fmt, ap); va_end(ap); } @@ -252,7 +252,7 @@ char* dialogue_input(char* title, int min, int max, const char* fmt, ...) { if(fmt == NULL) return NULL; else { /* Get the message. */ va_start(ap, fmt); - vsprintf(msg, fmt, ap); + vsnprintf(msg, 512, fmt, ap); va_end(ap); } diff --git a/src/font.c b/src/font.c index 18e9a5f..280cfe6 100644 --- a/src/font.c +++ b/src/font.c @@ -131,7 +131,7 @@ void gl_print(const glFont* ft_font, const double x, const double y, else { /* convert the symbols to text. */ va_start(ap, fmt); - vsprintf(txt, fmt, ap); + vsnprintf(txt, 256, fmt, ap); va_end(ap); } @@ -180,7 +180,7 @@ int gl_printMax(const glFont* ft_font, const int max, else { /* convert the symbols to text. */ va_start(ap, fmt); - vsprintf(txt, fmt, ap); + vsnprintf(txt, 256, fmt, ap); va_end(ap); } @@ -239,7 +239,7 @@ int gl_printMid(const glFont* ft_font, const int width, double x, const double y else { /* convert the symbols to text. */ va_start(ap, fmt); - vsprintf(txt, fmt, ap); + vsnprintf(txt, 256, fmt, ap); va_end(ap); } @@ -301,7 +301,7 @@ int gl_printText(const glFont* ft_font, const int width, const int height, else { /* Convert the symbols to text. */ va_start(ap, fmt); - vsprintf(txt, fmt, ap); + vsnprintf(txt, 4096, fmt, ap); va_end(ap); } bx -= (double)SCREEN_W/2.; @@ -360,7 +360,7 @@ int gl_printWidth(const glFont* ft_font, const char* fmt, ...) { else { /* Convert the symbols to text. */ va_start(ap, fmt); - vsprintf(txt, fmt, ap); + vsnprintf(txt, 256, fmt, ap); va_end(ap); } @@ -396,7 +396,7 @@ int gl_printHeight(const glFont* ft_font, const int width, else { /* Convert the symbols to text. */ va_start(ap, fmt); - vsprintf(txt, fmt, ap); + vsnprintf(txt, 1024, fmt, ap); va_end(ap); }