Fix a typo in the size constraints on physical layers.

This commit is contained in:
Mike Auty
2013-05-07 23:43:09 +01:00
parent 72d971bf3f
commit eb35ffb325
+1 -1
View File
@@ -65,7 +65,7 @@ class FileLayer(interfaces.layers.DataLayerInterface):
"""Reads from the file at offset for length"""
if not self.is_valid(offset):
raise exceptions.InvalidAddressException("Offset outside of the " + self.name + " file boundaries")
if not self.is_valid(offset + length):
if not self.is_valid(offset + (length - 1)):
raise exceptions.InvalidAddressException("Final offset outside of the " + self.name + " file boundaries")
if length < 0:
raise TypeError("Length must be positive")