From 1496f13d08baa05c7be393938e29f9df7956f8df Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Mon, 25 Mar 2019 11:09:35 +0100 Subject: [PATCH] xls_parser: Minor bugfix and doc addition --- oletools/xls_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oletools/xls_parser.py b/oletools/xls_parser.py index e29aadd..6e6c20d 100644 --- a/oletools/xls_parser.py +++ b/oletools/xls_parser.py @@ -101,7 +101,7 @@ def read_unicode(data, start_idx, n_chars): """ read a unicode string from a XLUnicodeStringNoCch structure """ # first bit 0x0 --> only low-bytes are saved, all high bytes are 0 # first bit 0x1 --> 2 bytes per character - low_bytes_only = (ord(data[start_idx]) == 0) + low_bytes_only = (ord(data[start_idx:start_idx+1]) == 0) if low_bytes_only: end_idx = start_idx + 1 + n_chars return data[start_idx+1:end_idx].decode('ascii'), end_idx @@ -349,6 +349,7 @@ class XlsRecordSupBook(XlsRecord): LINK_TYPE_EXTERNAL = 'external workbook' def finish_constructing(self, _): + """Finish constructing this record; called at end of constructor.""" # set defaults self.ctab = None self.cch = None -- libgit2 0.21.4