diff --git a/Userland/Libraries/LibELF/DynamicLinker.cpp b/Userland/Libraries/LibELF/DynamicLinker.cpp index ce09d4c5525..2bad9094139 100644 --- a/Userland/Libraries/LibELF/DynamicLinker.cpp +++ b/Userland/Libraries/LibELF/DynamicLinker.cpp @@ -100,7 +100,7 @@ static void map_library(const String& name, int fd) static void map_library(const String& name) { // TODO: Do we want to also look for libs in other paths too? - String path = String::format("/usr/lib/%s", name.characters()); + String path = String::formatted("/usr/lib/{}", name); int fd = open(path.characters(), O_RDONLY); ASSERT(fd >= 0); map_library(name, fd); diff --git a/Userland/Libraries/LibELF/DynamicLoader.cpp b/Userland/Libraries/LibELF/DynamicLoader.cpp index acb09d29f7e..03d28aff1fa 100644 --- a/Userland/Libraries/LibELF/DynamicLoader.cpp +++ b/Userland/Libraries/LibELF/DynamicLoader.cpp @@ -58,7 +58,7 @@ void* DynamicLoader::do_mmap(int fd, size_t size, const String& name) if (size < sizeof(Elf32_Ehdr)) return MAP_FAILED; - String file_mmap_name = String::format("ELF_DYN: %s", name.characters()); + String file_mmap_name = String::formatted("ELF_DYN: {}", name); return mmap_with_name(nullptr, size, PROT_READ, MAP_PRIVATE, fd, 0, file_mmap_name.characters()); } @@ -276,7 +276,7 @@ void DynamicLoader::load_program_headers() MAP_SHARED, m_image_fd, region->offset(), - String::format("%s: .text", m_filename.characters()).characters()); + String::formatted("{}: .text", m_filename).characters()); if (MAP_FAILED == text_segment_begin) { ASSERT_NOT_REACHED(); } @@ -297,7 +297,7 @@ void DynamicLoader::load_program_headers() MAP_ANONYMOUS | MAP_PRIVATE, 0, 0, - String::format("%s: .data", m_filename.characters()).characters()); + String::formatted("{}: .data", m_filename).characters()); if (MAP_FAILED == data_segment_begin) { ASSERT_NOT_REACHED(); } diff --git a/Userland/Libraries/LibELF/DynamicObject.cpp b/Userland/Libraries/LibELF/DynamicObject.cpp index 9189c68c942..6aafac3641f 100644 --- a/Userland/Libraries/LibELF/DynamicObject.cpp +++ b/Userland/Libraries/LibELF/DynamicObject.cpp @@ -64,7 +64,7 @@ void DynamicObject::dump() const size_t num_dynamic_sections = 0; for_each_dynamic_entry([&](const DynamicObject::DynamicEntry& entry) { - String name_field = String::format("(%s)", name_for_dtag(entry.tag())); + String name_field = String::formatted("({})", name_for_dtag(entry.tag())); builder.appendf("0x%08X %-17s0x%X\n", entry.tag(), name_field.characters(), entry.val()); num_dynamic_sections++; return IterationDecision::Continue;