diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-30 16:28:51 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-30 16:28:51 +0100 |
commit | 027d26cd5d6dbfceef0c2ade42a51068dcdcf43f (patch) | |
tree | 1c829b0a51edaf4c44b3d0b2a4c383b28fd2a563 /Kernel/VirtualConsole.cpp | |
parent | e9b948103d45b4e9b6498f62e70dd64152dea3e6 (diff) | |
download | serenity-027d26cd5d6dbfceef0c2ade42a51068dcdcf43f.zip |
Add a String::format() and use that in place of ksprintf() in the Kernel.
You're never gonna be right 100% of the time when guessing how much buffer
space you need. This avoids having to make that type of decision in a bunch
of cases. :^)
Diffstat (limited to 'Kernel/VirtualConsole.cpp')
-rw-r--r-- | Kernel/VirtualConsole.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Kernel/VirtualConsole.cpp b/Kernel/VirtualConsole.cpp index 55604c71ac..1e3227d02b 100644 --- a/Kernel/VirtualConsole.cpp +++ b/Kernel/VirtualConsole.cpp @@ -508,9 +508,7 @@ void VirtualConsole::on_tty_write(const byte* data, size_t size) String VirtualConsole::tty_name() const { - char buf[16]; - ksprintf(buf, "/dev/tty%u", m_index); - return String(buf); + return String::format("/dev/tty%u", m_index); } void VirtualConsole::set_vga_start_row(word row) |