From d8d265999b65afe289f7d8d8860ed492b1ff77d4 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Fri, 13 Jan 2012 13:27:40 +0000 Subject: [PATCH] mkenvimage: Really set the redundant byte when applicable Signed-off-by: David Wagner Acked-by: Mike Frysinger --- tools/mkenvimage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c index 3a20b23ed1..9dbb3b210b 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; -- 2.39.5