This commit is contained in:
Paul Sajna
2018-09-01 14:00:18 +00:00
committed by jD91mZM2
parent 3dbf9f872a
commit 07eb658a8a
23 changed files with 1616 additions and 52 deletions
+6 -3
View File
@@ -1,5 +1,5 @@
use core::fmt::Write as CoreWrite;
use core::{slice, str};
use core::{slice, str, ptr};
use platform::types::*;
use platform::{self, Write};
@@ -61,8 +61,11 @@ pub unsafe fn printf<W: Write>(w: W, format: *const c_char, mut ap: VaList) -> c
let a = ap.get::<*const c_char>();
found_percent = false;
w.write_str(str::from_utf8_unchecked(platform::c_str(a)))
if a != ptr::null() {
w.write_str(str::from_utf8_unchecked(platform::c_str(a)))
} else {
w.write_str("NULL")
}
}
'u' => {
let a = ap.get::<c_uint>();