From d286773afa7c9197947da008251302129fb026ed Mon Sep 17 00:00:00 2001 From: Daniel Dickinson Date: Mon, 15 Nov 2010 04:08:09 +0000 Subject: [PATCH] [tools] brcm63xx: imagetag: Fixed occaisonal wrong CRC in image due to using strncpy to copy the CRC into the imagetag. strncpy stops copying after a 00 byte, memcpy doesn't. SVN-Revision: 24000 --- tools/firmware-utils/src/imagetag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/firmware-utils/src/imagetag.c b/tools/firmware-utils/src/imagetag.c index 1fb45e9e95..0ecbada284 100644 --- a/tools/firmware-utils/src/imagetag.c +++ b/tools/firmware-utils/src/imagetag.c @@ -32,9 +32,9 @@ union int2char { char output[4]; }; -/* This appears to be necessary due to alignment issues */ +/* Convert uint32_t CRC to bigendian and copy it into a character array */ #define int2tag(tag, value) intchar.input = htonl(value); \ - strncpy(tag, intchar.output, sizeof(union int2char)) + memcpy(tag, intchar.output, sizeof(union int2char)) /* Kernel header */ struct kernelhdr { -- 2.30.2