diff --git a/src/cocoa/cocoa_fullscreen.m b/src/cocoa/cocoa_fullscreen.m index 95bd8538..8d23f057 100644 --- a/src/cocoa/cocoa_fullscreen.m +++ b/src/cocoa/cocoa_fullscreen.m @@ -83,7 +83,7 @@ int _glfwPlatformGetVideoModes(GLFWvidmode* list, int maxcount) NSArray* modes = (NSArray*) CGDisplayAvailableModes(CGMainDisplayID()); unsigned int i, j = 0, n = [modes count]; - for (i = 0; i < n && i < (unsigned)maxcount; i++) + for (i = 0; i < n && j < (unsigned)maxcount; i++) { NSDictionary *mode = [modes objectAtIndex:i]; if (modeIsGood(mode))