mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-04-18 13:20:44 +02:00
test: fix string encoding in the python test bindings
The protocol encoding is the string including the null byte. The test wrappers sent the right string length but only encoded strlen() bytes so where we had a string that's a multiple of 4 long we ended up claiming it's a byte longer than was on the wire. Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/314>
This commit is contained in:
parent
076e8bc670
commit
327dd4f8b1
1 changed files with 1 additions and 1 deletions
|
|
@ -174,7 +174,7 @@ class Interface:
|
|||
elif sig in ["s"]:
|
||||
encoding.append("I")
|
||||
arguments.append(len(arg) + 1)
|
||||
slen = ((len(arg) + 3) // 4) * 4
|
||||
slen = ((len(arg) + 1 + 3) // 4) * 4
|
||||
encoding.append(f"{slen}s")
|
||||
arg = arg.encode("utf8")
|
||||
elif sig in ["h"]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue