Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita22d2eb

Browse files
committed
Fix name length handling
1 parentd139c61 commita22d2eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎compoundfiles/entities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(self, parent, stream, index):
131131
warnings.warn(
132132
CompoundFileDirNameWarning(
133133
'missing NULL terminator in name'))
134-
self.name=self.name[:name_len]
134+
self.name=self.name[:(name_len//2)-1]
135135
ifindex==0:
136136
ifself._entry_type!=DIR_ROOT:
137137
warnings.warn(
@@ -206,11 +206,11 @@ def __init__(self, parent, stream, index):
206206
warnings.warn(
207207
CompoundFileDirSizeWarning(
208208
'invalid size in small sector file'))
209+
size_high=0
209210
ifsize_low>=1<<31:
210211
warnings.warn(
211212
CompoundFileDirSizeWarning(
212213
'size too large for small sector file'))
213-
size_high=0
214214
self.size= (size_high<<32)|size_low
215215
epoch=dt.datetime(1601,1,1)
216216
self.created= (

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp