lib/fit4ruby/FitFile.rb in fit4ruby-1.3.0 vs lib/fit4ruby/FitFile.rb in fit4ruby-1.4.0
- old
+ new
@@ -37,11 +37,11 @@
Log.fatal "Cannot open FIT file '#{file_name}': #{e.message}"
end
header = FitHeader.read(io)
header.check
- check_crc(io, header.end_pos)
+ check_crc(io, io.size - 2)
entity = FitFileEntity.new
# This Array holds the raw data of the records that may be needed to
# dump a human readable form of the FIT file.
records = []
@@ -104,10 +104,10 @@
crc_ref = io.readbyte.to_i | (io.readbyte.to_i << 8)
io.seek(start_pos)
unless crc == crc_ref
Log.fatal "Checksum error in file '#{@file_name}'. " +
- "Computed #{"%04X" % crc} instead of #{"%04X" % crc_ref}."
+ "Computed 0x#{"%04X" % crc} instead of 0x#{"%04X" % crc_ref}."
end
end
def write_crc(io, start_pos, end_pos)
# Compute the checksum over the data section of the file and append it