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
parent
14d62d0029
commit
ccc582cd58
|
@ -169,7 +169,7 @@ int keyboard_init(struct keyboard* self, const char* layout)
|
||||||
if (!keymap_string)
|
if (!keymap_string)
|
||||||
goto keymap_string_failure;
|
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);
|
int keymap_fd = shm_alloc_fd(keymap_len);
|
||||||
if (keymap_fd < 0)
|
if (keymap_fd < 0)
|
||||||
|
|
Loading…
Reference in New Issue