Changed np.uint16 to '<u2' because can't assume we're running on a little-endian machine

This commit is contained in:
Rob McMullen 2016-02-09 15:43:01 -08:00
parent 5ddd6808fc
commit 3b7c4a8b66

View File

@ -400,7 +400,7 @@ class AtariDosFile(object):
first = True
while pos < self.size:
if pos + 1 < self.size:
header, = bytes[pos:pos+2].view(dtype=np.uint16)
header, = bytes[pos:pos+2].view(dtype='<u2')
else:
self.segments.append(ObjSegment(pos, pos + 1, 0, 1, bytes[pos:pos + 1], "Incomplete Data"))
break
@ -414,7 +414,7 @@ class AtariDosFile(object):
if len(bytes[pos:pos + 4]) < 4:
self.segments.append(ObjSegment(0, 0, bytes[pos:pos + 4], "Short Segment Header"))
break
start, end = bytes[pos:pos + 4].view(dtype=np.uint16)
start, end = bytes[pos:pos + 4].view(dtype='<u2')
count = end - start + 1
found = len(bytes[pos + 4:pos + 4 + count])
if found < count: