Replace sprintf with snprintf

This commit is contained in:
Camilla Berglund
2016-09-30 05:31:07 +02:00
parent 9d42e146e7
commit ea1958a948
3 changed files with 14 additions and 13 deletions
+4 -4
View File
@@ -79,10 +79,10 @@ static void update_window_title(GLFWwindow* window)
{
char title[256];
sprintf(title, "Tearing detector (interval %i%s, %0.1f Hz)",
swap_interval,
(swap_tear && swap_interval < 0) ? " (swap tear)" : "",
frame_rate);
snprintf(title, sizeof(title), "Tearing detector (interval %i%s, %0.1f Hz)",
swap_interval,
(swap_tear && swap_interval < 0) ? " (swap tear)" : "",
frame_rate);
glfwSetWindowTitle(window, title);
}