keyboard: allocate shm with *actually* correct size

strlen returns "the number of characters that precede the terminating NUL".
We do need to send the \0 byte, since xkbcommon on the receiving end
*is* expecting a C string. And e.g. wlroots does strlen+1.
pull/32/head
Greg V 2020-04-06 22:51:54 +03:00
parent 14d62d0029
commit ccc582cd58
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ int keyboard_init(struct keyboard* self, const char* layout)
if (!keymap_string)
goto keymap_string_failure;
size_t keymap_len = strlen(keymap_string);
size_t keymap_len = strlen(keymap_string) + 1;
int keymap_fd = shm_alloc_fd(keymap_len);
if (keymap_fd < 0)