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>
This commit is contained in:
David Wagner 2012-01-13 13:27:40 +00:00 committed by Anatolij Gustschin
parent dc6449a9d8
commit d8d265999b

View File

@ -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;