From 9bc571af5ef9f37df2ee6e001f5ac7b6a7b9e7ee Mon Sep 17 00:00:00 2001 From: divVerent Date: Sat, 3 Sep 2022 07:44:03 -0400 Subject: [PATCH] internal/gamepad: fix a typo that caused oddly cut off gamepad names. (#2300) This change allows gamepad names up to 256 characters, which is usually enough. Before, names were cut off after 7 characters, matching the string "Unknown" that is used if querying the name fails. Closes #2300 --- internal/gamepad/gamepad_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/gamepad/gamepad_linux.go b/internal/gamepad/gamepad_linux.go index e2f3f80f1..96ab35081 100644 --- a/internal/gamepad/gamepad_linux.go +++ b/internal/gamepad/gamepad_linux.go @@ -149,7 +149,7 @@ func (*nativeGamepadsImpl) openGamepad(gamepads *gamepads, path string) (err err cname := make([]byte, 256) name := "Unknown" // TODO: Is it OK to ignore the error here? - if err := ioctl(fd, uint(_EVIOCGNAME(uint(len(name)))), unsafe.Pointer(&cname[0])); err == nil { + if err := ioctl(fd, uint(_EVIOCGNAME(uint(len(cname)))), unsafe.Pointer(&cname[0])); err == nil { name = unix.ByteSliceToString(cname) }