Skip to content

Commit

Permalink
fix: don't go out of bounds when scanning for available modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxnii committed Oct 18, 2024
1 parent ab586d7 commit ea6a6a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/lwjgl/src/main/kotlin/org/lwjglx/system/Monitor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Monitor internal constructor(internal val handle: Long) {
val modes = glfwGetVideoModes(handle)!!
val modeArray = Array<GLFWVidMode?>(modes.limit()) { null }

for (i in 0..modes.limit()) modeArray[i] = modes.get(i)
for (i in 0..<modes.limit()) modeArray[i] = modes.get(i)

return modeArray
.filterNotNull()
Expand Down

0 comments on commit ea6a6a0

Please sign in to comment.