Skip to content

Commit

Permalink
minor updates to documentation, bug fix for reading arrays with refer…
Browse files Browse the repository at this point in the history
…ence size greater than one
  • Loading branch information
stephen committed Dec 16, 2012
1 parent d92df6e commit 537140c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Format documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ File Sections

A binary plist file has four sections:

1. The first 8 bytes are an identifier and always equal to 'bplist00'.
1. The first 8 bytes are an identifier, equal to 'bplistXX' where XX is two digits. 'bplist00' and 'bplist01' are known, I don't know the differences.

2. Second is all of the elements in the plist, encoded and concatenated.

Expand All @@ -49,7 +49,7 @@ The final 32 bytes of a binary plist have the following format:

3. a 1 byte integer which is the number of bytes for an object reference
number. Valid values are 1 or 2. Reference numbers are encoded as
unsigned, bug endian integers.
unsigned, big endian integers.

4. 4 bytes of \x00 padding

Expand Down
2 changes: 1 addition & 1 deletion bplistlib/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def encode_body(self, array, object_length):

def decode_body(self, raw, object_length):
"""Decode the reference list into a flattened array."""
format_ = self.format * object_length
format_ = self.endian + self.format * object_length
array = unpack(format_, raw)
return list(array)

Expand Down

0 comments on commit 537140c

Please sign in to comment.