git.ithinksw.org
/
~jspiros
/
python-ebml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e9ebfb8
)
Fixed handling of null-termination in the string and unicode string readers.
author
Joseph Spiros
<joseph.spiros@ithinksw.com>
Wed, 13 Apr 2011 07:27:50 +0000
(
03:27
-0400)
committer
Joseph Spiros
<joseph.spiros@ithinksw.com>
Wed, 13 Apr 2011 07:27:50 +0000
(
03:27
-0400)
ebml/core.py
patch
|
blob
|
history
diff --git
a/ebml/core.py
b/ebml/core.py
index
0f390a8
..
8c01068
100644
(file)
--- a/
ebml/core.py
+++ b/
ebml/core.py
@@
-189,7
+189,7
@@
def read_string(stream, size):
value = ''
if size > 0:
value = stream.read(size)
- value = value.
rstrip(chr(0))
+ value = value.
partition(chr(0))[0]
return value
@@
-209,7
+209,7
@@
def read_unicode_string(stream, size):
value = u''
if size > 0:
data = stream.read(size)
- data = data.
rstrip(chr(0))
+ data = data.
partition(chr(0))[0]
value = unicode(data, 'utf_8')
return value