Patch [ 1583506 ] tarfile.py: 100-char filenames are truncated

This commit is contained in:
Georg Brandl 2006-10-24 16:54:16 +00:00
parent e97c759660
commit a32e0a099b
2 changed files with 28 additions and 1 deletions

View file

@ -136,7 +136,7 @@ TOEXEC = 0001 # execute/search by other
def stn(s, length):
"""Convert a python string to a null-terminated string buffer.
"""
return s[:length-1] + (length - len(s) - 1) * NUL + NUL
return s[:length] + (length - len(s)) * NUL
def nti(s):
"""Convert a number field to a python number.