diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-10-27 10:31:48 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-10-27 10:38:45 +0200 |
| commit | 0a724e48a7b7a4e0ece4d2ae4c95a78ac83ed4fe (patch) | |
| tree | 578fa21d40e3f2e2faccc4fd80b3618ca9cf9f62 | |
| parent | e497c51bb4af336e18fe5c5b8a3cce33afda180f (diff) | |
| download | vis-0a724e48a7b7a4e0ece4d2ae4c95a78ac83ed4fe.tar.gz vis-0a724e48a7b7a4e0ece4d2ae4c95a78ac83ed4fe.tar.xz | |
vis: fix :langmap behavior
The mapped to latin key has typically a shorter UTF-8 representation,
thus explicitly copy the NUL terminator to properly truncate the new
key value.
| -rw-r--r-- | vis.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -875,8 +875,8 @@ static const char *getkey(Vis *vis) { if (key.type == TERMKEY_TYPE_UNICODE && use_keymap) { const char *mapped = map_get(vis->keymap, key.utf8); if (mapped) { - size_t len = strlen(mapped); - if (len < sizeof(key.utf8)) + size_t len = strlen(mapped)+1; + if (len <= sizeof(key.utf8)) memcpy(key.utf8, mapped, len); } } |
