From e32acae368651c9a129c5b5b8e8138ec41db4b52 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Wed, 12 Dec 2018 17:43:43 +0000 Subject: Valid indices begin at 1, not 0! --- telem.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'telem.lua') diff --git a/telem.lua b/telem.lua index 704855c..51f312f 100755 --- a/telem.lua +++ b/telem.lua @@ -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 -- cgit v1.2.3