summaryrefslogtreecommitdiffstats
path: root/src/locale/keymap-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/locale/keymap-util.c')
-rw-r--r--src/locale/keymap-util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c
index 32af23d692..1bd8f5c0ae 100644
--- a/src/locale/keymap-util.c
+++ b/src/locale/keymap-util.c
@@ -648,9 +648,10 @@ int find_legacy_keymap(Context *c, char **ret) {
*/
char *l, *v = NULL, *converted;
- l = strndupa(c->x11_layout, strcspn(c->x11_layout, ","));
+ l = strndupa_safe(c->x11_layout, strcspn(c->x11_layout, ","));
if (c->x11_variant)
- v = strndupa(c->x11_variant, strcspn(c->x11_variant, ","));
+ v = strndupa_safe(c->x11_variant,
+ strcspn(c->x11_variant, ","));
r = find_converted_keymap(l, v, &converted);
if (r < 0)
return r;