diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-05-10 20:49:27 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-10 21:27:11 +0200 |
commit | 461acda76f1687590e247e707c26e79db2a622eb (patch) | |
tree | 59f5ebbf7e84332e5f16c2f73428a6db94a989a4 /Userland/Libraries | |
parent | 9909a3f01587a9c8ab04794e1068392662fb12c6 (diff) | |
download | serenity-461acda76f1687590e247e707c26e79db2a622eb.zip |
LibELF: Don't use assignments in return statements
Sure, this saves a couple of characters, but it's probably not
the best style.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibELF/Image.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Userland/Libraries/LibELF/Image.cpp b/Userland/Libraries/LibELF/Image.cpp index 2f43a2a788..1f2b78693e 100644 --- a/Userland/Libraries/LibELF/Image.cpp +++ b/Userland/Libraries/LibELF/Image.cpp @@ -141,13 +141,15 @@ bool Image::parse() if (m_size < sizeof(Elf32_Ehdr) || !validate_elf_header(header(), m_size, m_verbose_logging)) { if (m_verbose_logging) dbgln("ELF::Image::parse(): ELF Header not valid"); - return m_valid = false; + m_valid = false; + return false; } if (!validate_program_headers(header(), m_size, m_buffer, m_size, nullptr, m_verbose_logging)) { if (m_verbose_logging) dbgln("ELF::Image::parse(): ELF Program Headers not valid"); - return m_valid = false; + m_valid = false; + return false; } m_valid = true; @@ -156,8 +158,10 @@ bool Image::parse() for (unsigned i = 0; i < section_count(); ++i) { auto& sh = section_header(i); if (sh.sh_type == SHT_SYMTAB) { - if (m_symbol_table_section_index && m_symbol_table_section_index != i) - return m_valid = false; + if (m_symbol_table_section_index && m_symbol_table_section_index != i) { + m_valid = false; + return false; + } m_symbol_table_section_index = i; } if (sh.sh_type == SHT_STRTAB && i != header().e_shstrndx) { |