summaryrefslogtreecommitdiff
path: root/tools/firmware-utils
diff options
context:
space:
mode:
authorDaniel Dickinson <crazycshore@gmail.com>2010-11-15 04:08:09 +0000
committerDaniel Dickinson <crazycshore@gmail.com>2010-11-15 04:08:09 +0000
commit6cd4575153871296a1596dc9c27cd820f65b6ecc (patch)
treefad2b7212f04df0dc6d2d40b492d3ff04996037f /tools/firmware-utils
parent5bf3838a00e7946b2ce50a5c849f9bb270a185be (diff)
downloadmtk-20170518-6cd4575153871296a1596dc9c27cd820f65b6ecc.zip
mtk-20170518-6cd4575153871296a1596dc9c27cd820f65b6ecc.tar.gz
mtk-20170518-6cd4575153871296a1596dc9c27cd820f65b6ecc.tar.bz2
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
Diffstat (limited to 'tools/firmware-utils')
-rw-r--r--tools/firmware-utils/src/imagetag.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/firmware-utils/src/imagetag.c b/tools/firmware-utils/src/imagetag.c
index 1fb45e9..0ecbada 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 {