mirror of
https://github.com/RGBCube/serenity
synced 2025-07-29 02:17:34 +00:00
Kernel: Modify UART::print_str() to also take into account the length
Previously in the aarch64 Kernel, this would cause dbgln() to actually print more characters of the next string in memory, because strings in the Kernel are not zero terminated by default. Prevent this by using the passed in length of the string.
This commit is contained in:
parent
4a2dcea685
commit
47a58c51c6
3 changed files with 10 additions and 11 deletions
|
@ -22,9 +22,9 @@ public:
|
|||
void send(u32 c);
|
||||
u32 receive();
|
||||
|
||||
void print_str(char const* s)
|
||||
void print_str(char const* s, size_t length)
|
||||
{
|
||||
while (*s)
|
||||
for (size_t i = 0; i < length; ++i)
|
||||
send(*s++);
|
||||
}
|
||||
void print_num(u64 n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue