Use an array instead of an uninitialized wild pointer.

Using wild pointers is a dangerous practice, although you may not
encounter errors now.
This commit is contained in:
garenchan 2018-11-27 19:43:04 +08:00
parent 7aff64740e
commit bd527d3572

View File

@ -6,7 +6,7 @@
static void keyboard_callback(registers_t regs) { static void keyboard_callback(registers_t regs) {
/* The PIC leaves us the scancode in port 0x60 */ /* The PIC leaves us the scancode in port 0x60 */
u8 scancode = port_byte_in(0x60); u8 scancode = port_byte_in(0x60);
char *sc_ascii; char sc_ascii[4];
int_to_ascii(scancode, sc_ascii); int_to_ascii(scancode, sc_ascii);
kprint("Keyboard scancode: "); kprint("Keyboard scancode: ");
kprint(sc_ascii); kprint(sc_ascii);