scanner: allow for a zero terminated string as keymap
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 2 May 2023 04:15:55 +0000 (14:15 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 4 May 2023 23:57:23 +0000 (09:57 +1000)
commitb06aedb8badc0ed99bad01f11015dd3ac85e50bb
treeff601686cfbace70d8074c0c3ec868e7fee05c06
parent98b3314278f581f4ab9b3a5170341bdd7aea3719
scanner: allow for a zero terminated string as keymap

As the documentation for xkb_keymap_new_from_buffer() states, the "input string
does not have to be zero-terminated". The actual implementation however failed
with "unrecognized token/syntax error" when it encountered a null byte.

Fix this by allowing a null byte at the last position of the buffer. Anything
else is likely a client error anyway.

Fixes #307
src/keymap.c
test/buffercomp.c