mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 10:05:10 +00:00
Fix compilation with MSVC by using sprintf instead of snprintf
snprintf is part of c99 standard, not supported by MS compilers
This commit is contained in:
parent
2f095cc9e3
commit
704e56fc81
@ -46,9 +46,9 @@ static void set_swap_interval(GLFWwindow window, int interval)
|
|||||||
swap_interval = interval;
|
swap_interval = interval;
|
||||||
glfwSwapInterval(swap_interval);
|
glfwSwapInterval(swap_interval);
|
||||||
|
|
||||||
snprintf(title, sizeof(title),
|
sprintf(title,
|
||||||
"Cursor Inaccuracy Detector (interval %i)",
|
"Cursor Inaccuracy Detector (interval %i)",
|
||||||
swap_interval);
|
swap_interval);
|
||||||
|
|
||||||
glfwSetWindowTitle(window, title);
|
glfwSetWindowTitle(window, title);
|
||||||
}
|
}
|
||||||
|
@ -53,11 +53,11 @@ static const char* format_mode(GLFWvidmode* mode)
|
|||||||
{
|
{
|
||||||
static char buffer[512];
|
static char buffer[512];
|
||||||
|
|
||||||
snprintf(buffer, sizeof(buffer),
|
sprintf(buffer,
|
||||||
"%i x %i x %i (%i %i %i)",
|
"%i x %i x %i (%i %i %i)",
|
||||||
mode->width, mode->height,
|
mode->width, mode->height,
|
||||||
mode->redBits + mode->greenBits + mode->blueBits,
|
mode->redBits + mode->greenBits + mode->blueBits,
|
||||||
mode->redBits, mode->greenBits, mode->blueBits);
|
mode->redBits, mode->greenBits, mode->blueBits);
|
||||||
|
|
||||||
buffer[sizeof(buffer) - 1] = '\0';
|
buffer[sizeof(buffer) - 1] = '\0';
|
||||||
return buffer;
|
return buffer;
|
||||||
|
@ -43,9 +43,9 @@ static void set_swap_interval(GLFWwindow window, int interval)
|
|||||||
swap_interval = interval;
|
swap_interval = interval;
|
||||||
glfwSwapInterval(swap_interval);
|
glfwSwapInterval(swap_interval);
|
||||||
|
|
||||||
snprintf(title, sizeof(title),
|
sprintf(title,
|
||||||
"Tearing detector (interval %i)",
|
"Tearing detector (interval %i)",
|
||||||
swap_interval);
|
swap_interval);
|
||||||
|
|
||||||
glfwSetWindowTitle(window, title);
|
glfwSetWindowTitle(window, title);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user