Commit 2df5184c authored by Stefan Behnel's avatar Stefan Behnel

replace '0' bytes in strings when escaping

parent 7e0c0a49
...@@ -877,6 +877,7 @@ class CEnumType(CType): ...@@ -877,6 +877,7 @@ class CEnumType(CType):
def _escape_byte_string(s): def _escape_byte_string(s):
s = s.replace('\0', r'\x00')
try: try:
s.decode("ASCII") s.decode("ASCII")
return s return s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment