diff options
author | jdp <jdp@FreeBSD.org> | 1997-05-21 23:07:31 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1997-05-21 23:07:31 +0000 |
commit | a57b7759a5c877fc07cfd3ce98eefc8dc1524d82 (patch) | |
tree | 7802645405ee54b3e20f764f74b2ce5908cc7e4f /usr.bin/brandelf | |
parent | 0f85b0a29a90485a34342f497f7a499943150c6a (diff) | |
download | FreeBSD-src-a57b7759a5c877fc07cfd3ce98eefc8dc1524d82.zip FreeBSD-src-a57b7759a5c877fc07cfd3ce98eefc8dc1524d82.tar.gz |
Fill out the ELF header files to make them more or less complete.
Fix a macro name that was misspelled both in brandelf.c and
imgact_elf.h.
Diffstat (limited to 'usr.bin/brandelf')
-rw-r--r-- | usr.bin/brandelf/brandelf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/brandelf/brandelf.c b/usr.bin/brandelf/brandelf.c index c7a7030..e671794 100644 --- a/usr.bin/brandelf/brandelf.c +++ b/usr.bin/brandelf/brandelf.c @@ -25,15 +25,15 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: brandelf.c,v 1.4 1997/02/22 19:54:15 peter Exp $ + * $Id: brandelf.c,v 1.5 1997/03/29 04:28:17 imp Exp $ */ -#include <stdlib.h> +#include <elf.h> +#include <fcntl.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> -#include <fcntl.h> -#include <sys/imgact_elf.h> int usage(void); @@ -65,8 +65,8 @@ main(int argc, char **argv) } while (argc) { int fd; - char buffer[EI_NINDENT]; - char string[(EI_NINDENT-EI_SPARE)+1]; + char buffer[EI_NIDENT]; + char string[(EI_NIDENT-EI_BRAND)+1]; if ((fd = open(argv[0], O_RDWR, 0)) < 0) { fprintf(stderr, "No such file %s.\n", argv[0]); @@ -74,7 +74,7 @@ main(int argc, char **argv) goto fail; } - if (read(fd, buffer, EI_NINDENT) < EI_NINDENT) { + if (read(fd, buffer, EI_NIDENT) < EI_NIDENT) { fprintf(stderr, "File '%s' too short.\n", argv[0]); retval = 1; goto fail; @@ -88,7 +88,7 @@ main(int argc, char **argv) } if (!change) { bzero(string, sizeof(string)); - strncpy(string, &buffer[EI_SPARE], EI_NINDENT-EI_SPARE); + strncpy(string, &buffer[EI_BRAND], EI_NIDENT-EI_BRAND); if (strlen(string)) { fprintf(stdout, "File '%s' is of brand '%s'.\n", argv[0], string); @@ -98,9 +98,9 @@ main(int argc, char **argv) argv[0]); } else { - strncpy(&buffer[EI_SPARE], type, EI_NINDENT-EI_SPARE); + strncpy(&buffer[EI_BRAND], type, EI_NIDENT-EI_BRAND); lseek(fd, 0, SEEK_SET); - if (write(fd, buffer, EI_NINDENT) != EI_NINDENT) { + if (write(fd, buffer, EI_NIDENT) != EI_NIDENT) { fprintf(stderr, "Error writing %s\n", argv[0]); retval = 1; goto fail; |