Fixed C-string usage
parent
1d51f09bd1
commit
48ae217e41
|
|
@ -11,17 +11,16 @@ pub mod uart;
|
|||
|
||||
extern "C" {
|
||||
// printf.c
|
||||
fn panic(s: *const u8);
|
||||
fn panic(s: *const i8);
|
||||
}
|
||||
|
||||
/// '!RUST PANIC!\0'
|
||||
static PANIC_MSG: [u8; 13] = [33, 82, 85, 83, 84, 32, 80, 65, 78, 73, 67, 33, 0];
|
||||
static PANIC_MSG: &CStr = c"!RUST PANIC!";
|
||||
|
||||
#[panic_handler]
|
||||
#[no_mangle]
|
||||
fn panic_handler(_info: &core::panic::PanicInfo) -> ! {
|
||||
unsafe {
|
||||
panic(core::ptr::addr_of!(PANIC_MSG[0]));
|
||||
panic(PANIC_MSG.as_ptr());
|
||||
}
|
||||
loop {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue