When I wrote this I somehow forgot that the cursor could helpfully sit at sx
(one character off the right of the screen), so there are several out-of-bounds issues. Add some additional checking.

1 file changed