diff options
author | Ran Benita <ran234@gmail.com> | 2013-08-01 23:09:46 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2013-08-02 11:40:27 +0300 |
commit | e91d2653dd18e6dcace8923596c1f1a29bb9d1d4 (patch) | |
tree | 21e30277f51e22c6287dacffbe89bf21abd13633 /src/text.c | |
parent | e731b2514b96fcf92513c3f680a84666c0de3173 (diff) | |
download | libxkbcommon-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |