From: notaz Date: Tue, 10 Jun 2025 22:34:14 +0000 (+0300) Subject: input: fix a crash on disconnected dev config load X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da09f8f20da6548e1debf4abb9840eb9f130678d;p=libpicofe.git input: fix a crash on disconnected dev config load Because `kbd_binds` was null. in_bind_kbd_key() already handles it so just call it to reuse. --- diff --git a/input.c b/input.c index 92b47a2..369799c 100644 --- a/input.c +++ b/input.c @@ -994,14 +994,11 @@ int in_config_bind_kbd_key(int dev_id, const char *key, int kbd_key) kc = parse_key(dev, key); if (kc < 0 || kc >= dev->key_count) { - lprintf("input: bad key: '%s' for device '%s'\n", + lprintf("input: config_bind: bad key: '%s' for device '%s'\n", key, dev->name); return -1; } - - dev->kbd_binds[kc] = kbd_key; - - return 0; + return in_bind_kbd_key(dev_id, kc, kbd_key); } void in_clean_binds(void)