diff --git a/src/kernel/exception.rs b/src/kernel/exception.rs index 1c2e1d5..dad9c1c 100644 --- a/src/kernel/exception.rs +++ b/src/kernel/exception.rs @@ -176,6 +176,11 @@ fn syscall(machine: &mut Machine, system: &mut System) -> Result usize{ i + 1 } -fn get_string_param(addr: i64, maxlen: i64, machine: &Machine) -> Vec{ - let mut dest = Vec::with_capacity(maxlen as usize); +fn get_string_param(addr: i64, maxlen: usize, machine: &Machine) -> Vec{ + let mut dest = Vec::with_capacity(maxlen); - let mut i = 0; + let mut i: usize = 0; let mut c = 1; while c != 0 && i < maxlen { - c = machine.read_memory(1, (addr + i) as usize); + c = machine.read_memory(1, addr as usize + i); //dest.push(c as char); - dest[i] = c as char; + dest[i] = c as u8 as char; i += 1; }