LibBareMetal: Don't try to print characters from a null pointer
This commit is contained in:
parent
783c99516a
commit
dfa69b82b4
Notes:
sideshowbarker
2024-07-19 08:54:37 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/dfa69b82b42
1 changed files with 4 additions and 0 deletions
|
@ -155,6 +155,8 @@ 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;
|
||||
|
@ -162,6 +164,8 @@ extern "C" int dbgputstr(const char* characters, int length)
|
|||
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue