summaryrefslogtreecommitdiff
path: root/src/text.c
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2013-08-01 23:09:46 +0300
committerRan Benita <ran234@gmail.com>2013-08-02 11:40:27 +0300
commite91d2653dd18e6dcace8923596c1f1a29bb9d1d4 (patch)
tree21e30277f51e22c6287dacffbe89bf21abd13633 /src/text.c
parente731b2514b96fcf92513c3f680a84666c0de3173 (diff)
downloadlibxkbcommon-e91d2653dd18e6dcace8923596c1f1a29bb9d1d4.tar.gz
libxkbcommon-e91d2653dd18e6dcace8923596c1f1a29bb9d1d4.tar.bz2
libxkbcommon-e91d2653dd18e6dcace8923596c1f1a29bb9d1d4.zip
scanner: allow empty key name literals
Some keymaps actually have this, like the quartz.xkb which is tested. We need to support these. https://bugs.freedesktop.org/show_bug.cgi?id=67654 Reported-By: Gatis Paeglis <gatis.paeglis@digia.com> Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/text.c b/src/text.c
index 443fa1c..59d6c77 100644
--- a/src/text.c
+++ b/src/text.c
@@ -251,9 +251,9 @@ const char *
KeyNameText(struct xkb_context *ctx, xkb_atom_t name)
{
const char *sname = xkb_atom_text(ctx, name);
- size_t len = strlen(sname) + 3;
+ size_t len = strlen_safe(sname) + 3;
char *buf = xkb_context_get_buffer(ctx, len);
- snprintf(buf, len, "<%s>", sname);
+ snprintf(buf, len, "<%s>", strempty(sname));
return buf;
}