summaryrefslogtreecommitdiffstats
path: root/sway/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input.c')
-rw-r--r--sway/input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/input.c b/sway/input.c
index acd69a6b..61757ab8 100644
--- a/sway/input.c
+++ b/sway/input.c
@@ -45,6 +45,10 @@ char *libinput_dev_unique_id(struct libinput_device *device) {
45 45
46 int len = strlen(name) + sizeof(char) * 6; 46 int len = strlen(name) + sizeof(char) * 6;
47 char *identifier = malloc(len); 47 char *identifier = malloc(len);
48 if (!identifier) {
49 sway_log(L_ERROR, "Unable to allocate unique input device name");
50 return NULL;
51 }
48 52
49 const char *fmt = "%d:%d:%s"; 53 const char *fmt = "%d:%d:%s";
50 snprintf(identifier, len, fmt, vendor, product, name); 54 snprintf(identifier, len, fmt, vendor, product, name);