* (C) Copyright 2000-2004
* DENX Software Engineering
* Wolfgang Denk, wd@denx.de
* (C) Copyright 2000-2004
* DENX Software Engineering
* Wolfgang Denk, wd@denx.de
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
static void copy_file (int, const char *, int);
static void usage (void);
static void copy_file (int, const char *, int);
static void usage (void);
- if (fdt_check_header (ptr)) {
- /* old-style image */
- image_verify_header ((char *)ptr, sbuf.st_size);
- image_print_contents ((image_header_t *)ptr);
- } else {
+ if (!(retval = fdt_check_header (ptr))) {
- checksum = crc32 (0, (const char *)hdr, image_get_header_size ());
+ checksum = crc32 (0, (const unsigned char *)hdr,
+ image_get_header_size ());
len = image_size - sizeof(image_header_t) ;
if (crc32 (0, data, len) != be32_to_cpu(hdr->ih_dcrc)) {
fprintf (stderr,
"%s: ERROR: \"%s\" has corrupted data!\n",
cmdname, imagefile);
len = image_size - sizeof(image_header_t) ;
if (crc32 (0, data, len) != be32_to_cpu(hdr->ih_dcrc)) {
fprintf (stderr,
"%s: ERROR: \"%s\" has corrupted data!\n",
cmdname, imagefile);