Skip to content

Commit

Permalink
LibBareMetal: Don't try to print characters from a null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Mar 4, 2020
1 parent 783c995 commit dfa69b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Libraries/LibBareMetal/Output/kprintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,17 @@ static void debugger_putch(char*&, char ch)

extern "C" int dbgputstr(const char* characters, int length)
{
if (!characters)
return 0;
for (int i = 0; i < length; ++i)
debugger_out(characters[i]);
return 0;
}

extern "C" int kernelputstr(const char* characters, int length)
{
if (!characters)
return 0;
for (int i = 0; i < length; ++i)
console_out(characters[i]);
return 0;
Expand Down

0 comments on commit dfa69b8

Please sign in to comment.