diff options
author | Solderpunk <solderpunk@sdf.org> | 2018-12-08 17:05:23 +0000 |
---|---|---|
committer | Solderpunk <solderpunk@sdf.org> | 2018-12-08 17:05:23 +0000 |
commit | 783e1c7a52d57ee5393dcbceb1b5aec4c8bb3172 (patch) | |
tree | cb02815090354c7ce96a981f375762ffec4866c0 | |
parent | Have main command loop and the type command 'subshell' share the same dispatc... (diff) |
Check lengths of various string inputs and act accordingly in extreme cases.
Diffstat (limited to '')
-rwxr-xr-x | telem.lua | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -130,9 +130,16 @@ function do_board() if string.len(board) > 18 then print("Board names must be 18 characters or less!") return + elseif string.len(board) == 0 then + print("New board cancelled.") + return end - io.write("Description? ") + io.write("Board topic? (Max 48 chars)") local desc = io.read() + if string.len(desc) > 48 then + print("Board topics must be 48 characters or less!") + return + end -- Create directory local board_dir = path.join(_BBS_ROOT, "boards", board) lfs.mkdir(board_dir) @@ -195,6 +202,9 @@ function do_new() if string.len(subject) > 48 then print("Thread subjects must be 48 characters or less!") return + elseif string.len(subject) == 0 then + print("New thread cancelled.") + return end -- Save body of post to temp file local filename = os.tmpname() |