Alexandros Frantzis (@afrantzis) commented about dlls/winewayland.drv/wayland_keyboard.c:
if ((keymap_str = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0)) != MAP_FAILED) { if (format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1)
xkb_keymap = xkb_keymap_new_from_buffer(keyboard->xkb_context, keymap_str, size,
xkb_keymap = xkb_keymap_new_from_string(keyboard->xkb_context, keymap_str,
This is correct (WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 guarantees a null-terminated string), we can use this function already from the first commit that introduce xkb_keymaps.