summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwb9688 <wb9688@users.noreply.github.com>2019-12-31 18:31:45 +0100
committerSimon Ser <contact@emersion.fr>2020-07-15 19:27:12 +0200
commitc199c8d6ea3fb77697040f3d814af8d76c6e6d2d (patch)
tree4becab7b9aafad3438d27645a6e350194a46f9ce
parentcdff693e2ec13954831e423008241ce28dee538f (diff)
Replace unprintable characters in input device id
(cherry picked from commit 17ff13fc84fd74ddcee68a302af156d7bf81ed85)
-rw-r--r--sway/input/input-manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 69342c731..f04a8ce09 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -70,7 +70,8 @@ char *input_device_get_identifier(struct wlr_input_device *device) {
char *p = name;
for (; *p; ++p) {
- if (*p == ' ') {
+ // There are in fact input devices with unprintable characters in its name
+ if (*p == ' ' || !isprint(*p)) {
*p = '_';
}
}