summaryrefslogtreecommitdiffstats
path: root/arch/alpha/boot
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-07-30 11:02:39 +0800
committerMatt Turner <mattst88@gmail.com>2020-06-12 17:43:17 -0700
commit5f14596e55de458987ee38043019b3d5cd636af1 (patch)
treea00ed0e15cdef3dea659cac659d95c2ae30e2ccc /arch/alpha/boot
parent5bea3044a74acb3d780288c0fecd0eb25bdda24d (diff)
downloadlinux-5f14596e55de458987ee38043019b3d5cd636af1.tar.bz2
alpha: Replace strncmp with str_has_prefix
In commit b6b2735514bc ("tracing: Use str_has_prefix() instead of using fixed sizes") the newly introduced str_has_prefix() was used to replace error-prone strncmp(str, const, len). Here fix codes with the same pattern. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'arch/alpha/boot')
-rw-r--r--arch/alpha/boot/tools/objstrip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objstrip.c
index 825a16f5f622..08b430d25a31 100644
--- a/arch/alpha/boot/tools/objstrip.c
+++ b/arch/alpha/boot/tools/objstrip.c
@@ -148,7 +148,7 @@ main (int argc, char *argv[])
#ifdef __ELF__
elf = (struct elfhdr *) buf;
- if (elf->e_ident[0] == 0x7f && strncmp((char *)elf->e_ident + 1, "ELF", 3) == 0) {
+ if (elf->e_ident[0] == 0x7f && str_has_prefix((char *)elf->e_ident + 1, "ELF")) {
if (elf->e_type != ET_EXEC) {
fprintf(stderr, "%s: %s is not an ELF executable\n",
prog_name, inname);