projects
/
platform
/
upstream
/
libxkbcommon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
parser: change deprecated `%pure-parser` to `%define api.pure` (#370)
[platform/upstream/libxkbcommon.git]
/
src
/
keymap.c
diff --git
a/src/keymap.c
b/src/keymap.c
index
d2baf94
..
0291aed
100644
(file)
--- a/
src/keymap.c
+++ b/
src/keymap.c
@@
-194,6
+194,10
@@
xkb_keymap_new_from_buffer(struct xkb_context *ctx,
if (!keymap)
return NULL;
+ /* Allow a zero-terminated string as a buffer */
+ if (length > 0 && buffer[length - 1] == '\0')
+ length--;
+
if (!ops->keymap_new_from_string(keymap, buffer, length)) {
xkb_keymap_unref(keymap);
return NULL;