summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dged/keyboard.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dged/keyboard.c b/src/dged/keyboard.c
index 4d4526e..f13d449 100644
--- a/src/dged/keyboard.c
+++ b/src/dged/keyboard.c
@@ -162,7 +162,7 @@ uint32_t key_name(struct key *key, char *buf, size_t capacity) {
break;
}
- snprintf(buf, capacity, "%s%c", mod, tolower(key->key));
+ size_t written = snprintf(buf, capacity, "%s%c", mod, tolower(key->key));
- return 0;
+ return written > capacity ? capacity : written;
}