Skip to content

Commit

Permalink
Merge pull request #11 from tmecklem/tmecklem/eat-null-bytes-within-c…
Browse files Browse the repository at this point in the history
…gm-pages

Ignore null opcode bytes within a cgm page
  • Loading branch information
bewest authored Oct 18, 2016
2 parents aeee7c9 + 33e3c4e commit 85e5ff7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions decocare/cgm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ def decode (self):
prefix_records = []
for B in iter(lambda: self.stream.read(1), ""):
B = bytearray(B)

# eat nulls within the page to avoid 0-value sgv records
if B[0] == 0x00:
continue

record = self.suggest(B[0])
record['_tell'] = self.stream.tell( )
# read packet if needed
Expand Down

0 comments on commit 85e5ff7

Please sign in to comment.