test: strip all trailing zeroes from the protocol strings

This code worked because the only string we compared against was
"ei_connection_setup" which is 19 actual bytes.
This commit is contained in:
Peter Hutterer 2023-02-28 07:50:33 +10:00
parent 2aaf7acdfc
commit f9446e8c02

View file

@ -219,7 +219,7 @@ class Interface:
if not s:
s = None # zero-length string is None
else:
s = s.decode("utf8")[:-1] # strip trailing zero
s = s.decode("utf8").rstrip("\x00") # strip trailing zeroes
results.append(s)
else:
results.append(values.pop(0))