diff --git a/src/compose/state.c b/src/compose/state.c index 7a78891..ca8b8f1 100644 --- a/src/compose/state.c +++ b/src/compose/state.c @@ -168,17 +168,17 @@ xkb_compose_state_get_utf8(struct xkb_compose_state *state, /* If there's no string specified, but only a keysym, try to do the * most helpful thing. */ if (node->leaf.utf8 == 0 && node->leaf.keysym != XKB_KEY_NoSymbol) { - char name[64]; + char utf8[7]; int ret; - ret = xkb_keysym_to_utf8(node->leaf.keysym, name, sizeof(name)); + ret = xkb_keysym_to_utf8(node->leaf.keysym, utf8, sizeof(utf8)); if (ret < 0 || ret == 0) { /* ret < 0 is impossible. * ret == 0 means the keysym has no string representation. */ goto fail; } - return snprintf(buffer, size, "%s", name); + return snprintf(buffer, size, "%s", utf8); } return snprintf(buffer, size, "%s",