diff options
Diffstat (limited to 'libebl')
-rw-r--r-- | libebl/ChangeLog | 5 | ||||
-rw-r--r-- | libebl/eblobjnotetypename.c | 5 | ||||
-rw-r--r-- | libebl/eblopenbackend.c | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 33208f0d..fff66b3e 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,3 +1,8 @@ +2021-04-19 Martin Liska <mliska@suse.cz> + + * eblobjnotetypename.c (ebl_object_note_type_name): Use startswith. + * eblopenbackend.c (default_debugscn_p): Likewise. + 2020-12-16 Dmitry V. Levin <ldv@altlinux.org> * libeblP.h (_): Remove. diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c index 9daddcda..4662906d 100644 --- a/libebl/eblobjnotetypename.c +++ b/libebl/eblobjnotetypename.c @@ -31,6 +31,8 @@ # include <config.h> #endif +#include <system.h> + #include <inttypes.h> #include <stdio.h> #include <string.h> @@ -79,8 +81,7 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type, } } - if (strncmp (name, ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX, - strlen (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX)) == 0) + if (startswith (name, ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX)) { /* GNU Build Attribute notes (ab)use the owner name to store most of their data. Don't decode everything here. Just diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c index a8af1658..71fafed7 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c @@ -616,9 +616,9 @@ default_debugscn_p (const char *name) / sizeof (dwarf_scn_names[0])); for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt) if (strcmp (name, dwarf_scn_names[cnt]) == 0 - || (strncmp (name, ".zdebug", strlen (".zdebug")) == 0 + || (startswith (name, ".zdebug") && strcmp (&name[2], &dwarf_scn_names[cnt][1]) == 0) - || (strncmp (name, ".gnu.debuglto_", strlen (".gnu.debuglto_")) == 0 + || (startswith (name, ".gnu.debuglto_") && strcmp (&name[14], dwarf_scn_names[cnt]) == 0)) return true; |