mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
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:
@@ -153,9 +153,7 @@ ByteBuffer procfs$pid_cwd(Process& process)
|
||||
void ProcFS::add_process(Process& process)
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
char buf[16];
|
||||
ksprintf(buf, "%d", process.pid());
|
||||
auto dir = add_file(create_directory(buf));
|
||||
auto dir = add_file(create_directory(String::format("%d", process.pid())));
|
||||
m_pid2inode.set(process.pid(), dir.index());
|
||||
add_file(create_generated_file("vm", [&process] (SynthFSInode&) { return procfs$pid_vm(process); }), dir.index());
|
||||
add_file(create_generated_file("vmo", [&process] (SynthFSInode&) { return procfs$pid_vmo(process); }), dir.index());
|
||||
|
||||
Reference in New Issue
Block a user