]> err.no Git - gant/commitdiff
Fix off-by-one error
authorTollef Fog Heen <tfheen@err.no>
Tue, 17 Jan 2012 20:30:42 +0000 (21:30 +0100)
committerTollef Fog Heen <tfheen@err.no>
Tue, 17 Jan 2012 20:30:42 +0000 (21:30 +0100)
fr60.c

diff --git a/fr60.c b/fr60.c
index 17564f54845050888de091665fd03edddbee4cda..32fc5bfbc55d02d7a95050f547d0d4bf34b627c5 100644 (file)
--- 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;
                                }