Fix off by one error in random loading text #1

Merged
mewrrythekibby merged 1 commit from off-by-one-bugfix into main 2025-11-16 03:12:48 +00:00
Showing only changes of commit e48d326489 - Show all commits

View file

@ -69,8 +69,10 @@ function Load (text) {
const loadArray = text.split("\n")
const loading = document.getElementsByClassName("loading")[0]
const r = Math.floor(Math.random() * loadArray.length)
const r = Math.floor(Math.random() * (loadArray.length-1))
const loadText = loadArray[r]
if (loadText === '') //Error message on bad string
alert("Please tell a linuxposting.xyz admin member: Error Code 0x756C2D616F6365640A72")
loading.children[0].innerHTML = loadText + "."
loading.children[1].innerHTML = loadText + ".."
@ -341,4 +343,4 @@ window.addEventListener("resize", () => {
resizeTimeout = setTimeout(() => {
document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`)
}, 200)
})
})