1 diff --git a/src/libkeymap/dump.c b/src/libkeymap/dump.c
2 index 83ac351..8531b5a 100644
3 --- a/src/libkeymap/dump.c
4 +++ b/src/libkeymap/dump.c
5 @@ -72,9 +72,14 @@ int lk_dump_bkeymap(struct lk_ctx *ctx, FILE *fd)
8 for (j = 0; j < NR_KEYS / 2; j++) {
9 - int v = lk_get_key(ctx, i, j);
10 + int value = lk_get_key(ctx, i, j);
12 - if (fwrite(&v, sizeof(v), 1, fd) != 1)
13 + if (value < 0 || value > USHRT_MAX) {
14 + ERR(ctx, _("can not bind key %d to value %d because it is too large"), j, value);
18 + if (fwrite(&value, sizeof(unsigned short), 1, fd) != 1)