mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 05:36:35 +00:00
Cleanup pointer test in win32_window.c
MSVC 2019 complains that the code at line 1744 (`GetMonitorInfo(window->monitor->win32.handle, &mi);`) can potentially dereference a null pointer. The compiler is wrong in this case (it has not spotted that `monitor` and `window->monitor` must be equal), but I think it makes sense for our non-NULL test to be on the variable we actually use rather than the one it was set from.
This commit is contained in:
parent
d834f01ca4
commit
5950382616
@ -1725,7 +1725,7 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
|
||||
|
||||
_glfwInputWindowMonitor(window, monitor);
|
||||
|
||||
if (monitor)
|
||||
if (window->monitor)
|
||||
{
|
||||
MONITORINFO mi = { sizeof(mi) };
|
||||
UINT flags = SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOCOPYBITS;
|
||||
|
Loading…
Reference in New Issue
Block a user