From: Rafał Miłecki <[email protected]> Just use already read data.
Signed-off-by: Rafał Miłecki <[email protected]> --- src/otrx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/otrx.c b/src/otrx.c index b5cd70d..aa81c96 100644 --- a/src/otrx.c +++ b/src/otrx.c @@ -193,8 +193,8 @@ static int otrx_check(int argc, char **argv) { } crc32 = 0xffffffff; - fseek(trx, trx_offset + TRX_FLAGS_OFFSET, SEEK_SET); - length -= TRX_FLAGS_OFFSET; + crc32 = otrx_crc32(crc32, (uint8_t *)&hdr + TRX_FLAGS_OFFSET, sizeof(hdr) - TRX_FLAGS_OFFSET); + length -= sizeof(hdr); while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { crc32 = otrx_crc32(crc32, buf, bytes); length -= bytes; -- 2.31.1 _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
