hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/alpha/boot/tools/objstrip.c
....@@ -148,7 +148,7 @@
148148 #ifdef __ELF__
149149 elf = (struct elfhdr *) buf;
150150
151
- if (elf->e_ident[0] == 0x7f && strncmp((char *)elf->e_ident + 1, "ELF", 3) == 0) {
151
+ if (memcmp(&elf->e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) {
152152 if (elf->e_type != ET_EXEC) {
153153 fprintf(stderr, "%s: %s is not an ELF executable\n",
154154 prog_name, inname);