Add more to the Utf8CStr family

Better C strings with path operations
This commit is contained in:
topjohnwu
2023-09-12 17:35:01 -07:00
parent 4eaf701cb7
commit 89aee6ffa7
13 changed files with 783 additions and 437 deletions

View File

@@ -51,10 +51,12 @@ pub fn setup_klog() {
fn klog_write_impl(_: LogLevel, msg: &[u8]) {
if let Some(kmsg) = KMSG.get().as_mut() {
let mut buf: [u8; 4096] = [0; 4096];
let mut len = copy_str(&mut buf, b"magiskinit: ");
len += copy_str(&mut buf[len..], msg);
kmsg.write_all(&buf[..len]).ok();
let mut buf = Utf8CStrArr::default();
buf.append("magiskinit: ");
unsafe {
buf.append_unchecked(msg);
}
kmsg.write_all(buf.as_bytes()).ok();
}
}