aboutsummaryrefslogtreecommitdiff
path: root/TUI/windows.jai
diff options
context:
space:
mode:
Diffstat (limited to 'TUI/windows.jai')
-rw-r--r--TUI/windows.jai5
1 files changed, 3 insertions, 2 deletions
diff --git a/TUI/windows.jai b/TUI/windows.jai
index 85dab0b..036b33b 100644
--- a/TUI/windows.jai
+++ b/TUI/windows.jai
@@ -171,9 +171,10 @@ OS_set_input_mode :: (mode: Input_Mode) {
}
OS_read_input :: (buffer: *u8, bytes_to_read: s64) -> bytes_read: s64, error: bool = false, error_message: string = "" {
+ assert(bytes_to_read <= 0x7fff_ffff, "The Windows API only allows to read up to s32 bytes from the standard input.");
bytes_read: s32;
- error := ReadConsoleA(stdin, buffer, bytes_to_read, *bytes_read);
- if error {
+ success := ReadConsoleA(stdin, buffer, cast(s32)bytes_to_read, *bytes_read);
+ if success == false {
_, error_message := get_error_value_and_string();
return -1, true, error_message;
}