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/ELFLoader.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/ELFLoader.cpp')
-rw-r--r-- | Kernel/ELFLoader.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Kernel/ELFLoader.cpp b/Kernel/ELFLoader.cpp index 324e2dff4b..35e11f0768 100644 --- a/Kernel/ELFLoader.cpp +++ b/Kernel/ELFLoader.cpp @@ -205,15 +205,11 @@ char* ELFLoader::symbol_ptr(const char* name) bool ELFLoader::allocate_section(LinearAddress laddr, size_t size, size_t alignment, bool is_readable, bool is_writable) { ASSERT(alloc_section_hook); - char namebuf[16]; - ksprintf(namebuf, "elf-alloc-%s%s", is_readable ? "r" : "", is_writable ? "w" : ""); - return alloc_section_hook(laddr, size, alignment, is_readable, is_writable, namebuf); + return alloc_section_hook(laddr, size, alignment, is_readable, is_writable, String::format("elf-alloc-%s%s", is_readable ? "r" : "", is_writable ? "w" : "")); } bool ELFLoader::map_section(LinearAddress laddr, size_t size, size_t alignment, size_t offset_in_image, bool is_readable, bool is_writable) { ASSERT(alloc_section_hook); - char namebuf[16]; - ksprintf(namebuf, "elf-map-%s%s", is_readable ? "r" : "", is_writable ? "w" : ""); - return map_section_hook(laddr, size, alignment, offset_in_image, is_readable, is_writable, namebuf); + return map_section_hook(laddr, size, alignment, offset_in_image, is_readable, is_writable, String::format("elf-map-%s%s", is_readable ? "r" : "", is_writable ? "w" : "")); } |