diff options
author | Solderpunk <solderpunk@sdf.org> | 2018-12-12 17:43:43 +0000 |
---|---|---|
committer | Solderpunk <solderpunk@sdf.org> | 2018-12-12 17:43:43 +0000 |
commit | e32acae368651c9a129c5b5b8e8138ec41db4b52 (patch) | |
tree | cd491123716c55548267e1f4ec6a5aac8cb71178 /telem.lua | |
parent | Don't hardcode a Lua version. (diff) |
Valid indices begin at 1, not 0!
Diffstat (limited to '')
-rwxr-xr-x | telem.lua | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -227,7 +227,7 @@ function do_go() print("No such board! Hit `l` to list boards.") else local index = tonumber(board) - if index < 0 or index > #boards then + if index < 1 or index > #boards then print("No such board! Hit `l` to list boards.") else current_board = boards[index] @@ -478,7 +478,7 @@ function do_type() if not check_at_board() then return end io.write("Read which thread? ") local thread_id = tonumber(io.read()) - if not thread_id or thread_id < 0 or thread_id > #current_board_threads then + if not thread_id or thread_id < 1 or thread_id > #current_board_threads then print("Invalid thread index!") return end @@ -503,7 +503,7 @@ function do_reply() if not check_at_board() then return end io.write("Reply to which thread? ") local thread_id = tonumber(io.read()) - if not thread_id or thread_id < 0 or thread_id > #current_board_threads then + if not thread_id or thread_id < 1 or thread_id > #current_board_threads then print("Invalid thread index!") return end |