From b61b447472b6a0a05feeb53f3953c3e8c93105c8 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sat, 30 Nov 2013 18:30:56 +0000 Subject: [PATCH] firmware-utils/trx: fix two bugs - fix crc32 calculation if -F was enabled. - don't convert the crc32 to little endian twice. Signed-off-by: Christian Lamparter SVN-Revision: 38962 --- tools/firmware-utils/src/trx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/firmware-utils/src/trx.c b/tools/firmware-utils/src/trx.c index 8e95d98d7ae..e3b6a3941fc 100644 --- a/tools/firmware-utils/src/trx.c +++ b/tools/firmware-utils/src/trx.c @@ -273,11 +273,10 @@ int main(int argc, char **argv) } p->crc32 = crc32buf((char *) &p->flag_version, - (fsmark)?fsmark:cur_len - offsetof(struct trx_header, flag_version)); + ((fsmark)?fsmark:cur_len) - offsetof(struct trx_header, flag_version)); p->crc32 = STORE32_LE(p->crc32); p->len = STORE32_LE((fsmark) ? fsmark : cur_len); - p->len = STORE32_LE(p->len); /* restore TRXv2 bin-header */ if (trx_version == 2) { -- 2.30.2