Skip to content
Snippets Groups Projects
Unverified Commit a3df8e44 authored by bors[bot]'s avatar bors[bot] Committed by GitHub
Browse files

Merge #730


730: remove trailing null characters r=stlankes a=stlankes

- revert also #729 

Co-authored-by: Stefan Lankes's avatarStefan Lankes <slankes@eonerc.rwth-aachen.de>
parents bc1fd13d b78a10aa
No related branches found
No related tags found
No related merge requests found
Pipeline #971577 passed
......@@ -44,7 +44,7 @@ fn get_cmdline_str() -> &'static str {
} else {
// SAFETY: cmdline and cmdsize are valid forever.
let slice = unsafe { slice::from_raw_parts(cmdline, cmdsize) };
str::from_utf8(slice).unwrap()
str::from_utf8(slice).unwrap().trim_matches(char::from(0))
}
}
......
......@@ -32,7 +32,7 @@ pub trait SyscallInterface: Send + Sync {
let mut envv = Vec::new();
let envs = env::vars();
debug!("Setting env as: {:?}", envs);
debug!("Setting envv as: {:?}", envs);
for (key, value) in envs {
let ptr = Box::leak(format!("{key}={value}\0").into_boxed_str()).as_ptr();
envv.push(ptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment