Fixed index out of bounds in term.isWide, closes #484.

This commit is contained in:
Florian Nücke 2014-08-12 02:51:17 +02:00
parent df9438db8e
commit a2e2a9b72e

View File

@ -81,6 +81,13 @@ function term.setCursorBlink(enabled)
end
function term.isWide(x, y)
if not term.isAvailable() then
return false
end
local w, h = component.gpu.getResolution()
if x < 1 or x > w or y < 1 or y > h then
return false
end
local char = component.gpu.get(x, y)
if unicode.isWide(char) then
-- The char at the specified position is a wide char.