patch [ 1300515 ] xdrlib.py: pack_fstring() did not use null bytes for padding

This commit is contained in:
Georg Brandl 2005-09-29 20:49:16 +00:00
parent 1aa74ee5c5
commit aa93517de8
2 changed files with 4 additions and 1 deletions

View file

@ -79,8 +79,8 @@ class Packer:
def pack_fstring(self, n, s):
if n < 0:
raise ValueError, 'fstring size must be nonnegative'
n = ((n+3)/4)*4
data = s[:n]
n = ((n+3)/4)*4
data = data + (n - len(data)) * '\0'
self.__buf.write(data)