summaryrefslogtreecommitdiffstats
path: root/utils/nwztools
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2020-10-11 13:07:04 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2020-10-11 13:08:03 +0200
commite371dee4a3278c6912ac5b1548042ae1d894bf6f (patch)
tree2fce74637311aff276d4ab6e669c0c11f48648e6 /utils/nwztools
parent8ce60c54f762b2f1392bee586dc8292170c87696 (diff)
downloadrockbox-e371dee4a3278c6912ac5b1548042ae1d894bf6f.tar.gz
rockbox-e371dee4a3278c6912ac5b1548042ae1d894bf6f.tar.bz2
rockbox-e371dee4a3278c6912ac5b1548042ae1d894bf6f.zip
nwztool: fix computation
It turns out the calculation gives the right result for the wrong reason, this fixes it. Change-Id: I36053c8993b5ae1e85380da59546ffade265fb3f
Diffstat (limited to 'utils/nwztools')
-rw-r--r--utils/nwztools/upgtools/upg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/nwztools/upgtools/upg.c b/utils/nwztools/upgtools/upg.c
index 88eca59335..3270ced39b 100644
--- a/utils/nwztools/upgtools/upg.c
+++ b/utils/nwztools/upgtools/upg.c
@@ -165,7 +165,7 @@ struct upg_file_t *upg_read_memory(void *buf, size_t size, const char *key,
/* check MD5 */
uint8_t actual_md5[NWZ_MD5_SIZE];
- MD5_CalculateDigest(actual_md5, (md5 + 1), size - sizeof(struct upg_header_t));
+ MD5_CalculateDigest(actual_md5, (md5 + 1), size - NWZ_MD5_SIZE);
if(memcmp(actual_md5, md5->md5, NWZ_MD5_SIZE) != 0)
{
cprintf(RED, "Mismatch\n");