summaryrefslogtreecommitdiff
path: root/tools/mkenvimage.c
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@free-electrons.com>2012-01-13 13:27:40 +0000
committerAnatolij Gustschin <agust@denx.de>2012-03-27 10:19:00 +0200
commitd8d265999b65afe289f7d8d8860ed492b1ff77d4 (patch)
tree36d0673b2c05d70aaefcfcb0257f364dcf3b1fc1 /tools/mkenvimage.c
parentdc6449a9d8c27899b9bbdaaf49d1535f7a41fd8e (diff)
downloadu-boot-imx-d8d265999b65afe289f7d8d8860ed492b1ff77d4.zip
u-boot-imx-d8d265999b65afe289f7d8d8860ed492b1ff77d4.tar.gz
u-boot-imx-d8d265999b65afe289f7d8d8860ed492b1ff77d4.tar.bz2
mkenvimage: Really set the redundant byte when applicable
Signed-off-by: David Wagner <david.wagner@free-electrons.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tools/mkenvimage.c')
-rw-r--r--tools/mkenvimage.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
index 3a20b23..9dbb3b2 100644
--- a/tools/mkenvimage.c
+++ b/tools/mkenvimage.c
@@ -285,7 +285,9 @@ int main(int argc, char **argv)
crc = crc32(0, envptr, envsize);
targetendian_crc = bigendian ? cpu_to_be32(crc) : cpu_to_le32(crc);
- memcpy(dataptr, &targetendian_crc, sizeof(uint32_t));
+ memcpy(dataptr, &targetendian_crc, sizeof(targetendian_crc));
+ if (redundant)
+ dataptr[sizeof(targetendian_crc)] = 1;
if (!bin_filename || strcmp(bin_filename, "-") == 0) {
bin_fd = STDOUT_FILENO;