aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolderpunk <solderpunk@sdf.org>2018-12-12 17:43:43 +0000
committerSolderpunk <solderpunk@sdf.org>2018-12-12 17:43:43 +0000
commite32acae368651c9a129c5b5b8e8138ec41db4b52 (patch)
treecd491123716c55548267e1f4ec6a5aac8cb71178
parentDon't hardcode a Lua version. (diff)
Valid indices begin at 1, not 0!
-rwxr-xr-xtelem.lua6
1 files changed, 3 insertions, 3 deletions
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