wasm new line fix

This commit is contained in:
Krzosa Karol
2025-01-21 13:50:58 +01:00
parent 5176a554e8
commit 515737f477

View File

@@ -25,7 +25,11 @@ fn void os_error_box(char *str) {
} }
fn void os_console_log(char *str) { fn void os_console_log(char *str) {
wasm_write_to_console((isize)str, str_len(str)); s8_t string = s8_from_char(str);
if (s8_ends_with(string, s8_lit("\n"), false)) {
string = s8_chop(string, 1);
}
wasm_write_to_console((isize)string.str, (i32)string.len);
} }
fn f64 os_parse_float(char *str) { fn f64 os_parse_float(char *str) {