From cd3f296fc5cff8492b055e289701f39a0e253ae1 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 11 Oct 2024 17:16:33 -0400 Subject: [PATCH] More compatibility fixes --- cmd/bulb/main.ha | 3 ++- internal/bulb/bulb.ha | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/bulb/main.ha b/cmd/bulb/main.ha index c427cf9..dd6fa68 100644 --- a/cmd/bulb/main.ha +++ b/cmd/bulb/main.ha @@ -32,7 +32,8 @@ export fn main() void = { let post = false; let anonymous = false; - for (let opt .. cmd.opts) { + for (let index = 0z; index < len(cmd.opts); index += 1) { + let opt = cmd.opts[index]; switch (opt.0) { case 'b' => board = opt.1; diff --git a/internal/bulb/bulb.ha b/internal/bulb/bulb.ha index 7a3d235..89e2228 100644 --- a/internal/bulb/bulb.ha +++ b/internal/bulb/bulb.ha @@ -6,6 +6,7 @@ use io; use os; use path; use strings; +use types; // TODO // two issues: @@ -44,7 +45,7 @@ export fn read(output: io::handle, board: str, number: int) (void | error) = { static let output_wbuf: [os::BUFSZ]u8 = [0...]; let output = bufio::init(output, [], output_wbuf); - let file = bufio::newscanner(file); + let file = bufio::newscanner(file, types::SIZE_MAX); defer bufio::finish(&file); let saw_escape = false; @@ -87,7 +88,7 @@ export fn post(input: io::handle, board: str, user_name: (str | void)) (void | e static let file_wbuf: [os::BUFSZ]u8 = [0...]; let file = bufio::init(file, [], file_wbuf); - let input = bufio::newscanner(input); + let input = bufio::newscanner(input, types::SIZE_MAX); defer bufio::finish(&input); let saw_break = false;