Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.bin/file Approved by thorpej:



details:   https://anonhg.NetBSD.org/src/rev/6b4cc84b5fa1
branches:  netbsd-1-5
changeset: 488747:6b4cc84b5fa1
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Jul 26 23:19:00 2000 +0000

description:
Approved by thorpej:
Make the code to determine whether we need to byte-swap headers at least
pretend to work on 64-bit hosts (and not overrun an array).

basesrc/usr.bin/file/readelf.c                          1.6 -> 1.7

diffstat:

 usr.bin/file/readelf.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r fd0f3c3f049a -r 6b4cc84b5fa1 usr.bin/file/readelf.c
--- a/usr.bin/file/readelf.c    Wed Jul 26 23:18:20 2000 +0000
+++ b/usr.bin/file/readelf.c    Wed Jul 26 23:19:00 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readelf.c,v 1.6 2000/05/14 22:53:38 christos Exp $     */
+/*     $NetBSD: readelf.c,v 1.6.4.1 2000/07/26 23:19:00 mycroft Exp $  */
 
 #include "file.h"
 
@@ -20,7 +20,7 @@
 #if 0
 FILE_RCSID("@(#)Id: readelf.c,v 1.12 2000/04/11 02:32:35 christos Exp ")
 #else
-__RCSID("$NetBSD: readelf.c,v 1.6 2000/05/14 22:53:38 christos Exp $");
+__RCSID("$NetBSD: readelf.c,v 1.6.4.1 2000/07/26 23:19:00 mycroft Exp $");
 #endif
 #endif
 
@@ -384,7 +384,7 @@
 
                u.l = 1;
                (void) memcpy(&elfhdr, buf, sizeof elfhdr);
-               swap = (u.c[sizeof(long) - 1] + 1) != elfhdr.e_ident[5];
+               swap = (u.c[sizeof(int32) - 1] + 1) != elfhdr.e_ident[5];
 
                if (getu16(swap, elfhdr.e_type) == ET_CORE) 
 #ifdef ELFCORE
@@ -421,7 +421,7 @@
 
                u.l = 1;
                (void) memcpy(&elfhdr, buf, sizeof elfhdr);
-               swap = (u.c[sizeof(long) - 1] + 1) != elfhdr.e_ident[5];
+               swap = (u.c[sizeof(int32) - 1] + 1) != elfhdr.e_ident[5];
 
                if (getu16(swap, elfhdr.e_type) == ET_CORE) 
 #ifdef ELFCORE



Home | Main Index | Thread Index | Old Index