Closed LillyProgrammingIncorprated closed 2 years ago
I wanted to read input, as you can do with any programming language and do in most programs.
System info: Operating System & Odin Version: Windows 10 Enterprise (version 21H2), Latest nightly build as of 25/02/2022
It was supposed to read n number of bytes since I have a slice with n bytes allocated and free.
It only reads 1 byte for every 4 bytes free on the slice
It only reads 1 byte per 4 bytes available, reducing the available space down to len // 4
Example Code which reproduces the problem:
package main import "core:os" import "core:mem" import "core:fmt" main :: proc () { test := make([]u8, 16) x, y := os.read(os.stdin, test) fmt.println(x) }
EDIT: Edited the steps to be more clear
With the latest nightly build passing a buffer of size 16 and inputting 14 characters does not end the input.
Context
I wanted to read input, as you can do with any programming language and do in most programs.
System info: Operating System & Odin Version: Windows 10 Enterprise (version 21H2), Latest nightly build as of 25/02/2022
Expected Behavior
It was supposed to read n number of bytes since I have a slice with n bytes allocated and free.
Current Behavior
It only reads 1 byte for every 4 bytes free on the slice
Failure Information (for bugs)
It only reads 1 byte per 4 bytes available, reducing the available space down to len // 4
Steps to Reproduce
Example Code which reproduces the problem:
EDIT: Edited the steps to be more clear