From f38e60cbeb2be872c00a9c155092eacc847a9773 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Tue, 17 Jan 2012 21:30:42 +0100 Subject: [PATCH] Fix off-by-one error --- fr60.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fr60.c b/fr60.c index 17564f5..32fc5bf 100644 --- a/fr60.c +++ b/fr60.c @@ -401,7 +401,7 @@ save_antfs_file(const uchar chan, const uchar* blast, uint blsize) if (verbose) printf("%s (%d bytes)\n", filename, size); ANT_RequestMessage(chan, MESG_CHANNEL_STATUS_ID); //informative if (offset+remaining < size) { - int16_t crc = le16_read(blast + blsize - 1); + int16_t crc = le16_read(blast + blsize - 2); printf("=> Starting download: %d %d %d\n", offset, remaining, size); start_download(chan, antfsdir[downloadingfilenum].fileno,offset+remaining, crc, 0); @@ -648,7 +648,7 @@ chevent(uchar chan, uchar event) decode_antfs_dir(blast, blsize); if (offset+remaining < size) { - int16_t crc = le16_read(blast + blsize - 1); + int16_t crc = le16_read(blast + blsize - 2); start_download(chan, 0, offset+remaining, crc, 0); return 1; } -- 2.39.5