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. :^)
This commit is contained in:
Andreas Kling 2019-01-30 16:28:51 +01:00
commit 027d26cd5d
Notes: sideshowbarker 2024-07-19 15:55:19 +09:00
11 changed files with 40 additions and 34 deletions

View file

@ -19,9 +19,7 @@ SlavePTY::~SlavePTY()
String SlavePTY::tty_name() const
{
char buffer[32];
ksprintf(buffer, "/dev/pts/%u", m_index);
return buffer;
return String::format("/dev/pts/%u", m_index);
}
void SlavePTY::on_master_write(const byte* buffer, size_t size)