From d2d35263a4f4bc7f0b399e957c7e3bf9f23537b6 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 20 Nov 2024 13:00:41 +0100 Subject: [PATCH] port: sanitize controller names because apparently some of them can't fucking resist putting a funny R or TM in there --- port/src/input.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/port/src/input.c b/port/src/input.c index 13f192b42..3912e28d8 100644 --- a/port/src/input.c +++ b/port/src/input.c @@ -990,6 +990,13 @@ const char *inputGetConnectedControllerName(s32 id) snprintf(fullName, sizeof(fullName), "%d: %s", jidx, name); + // replace non-ascii chars with spaces + for (char *p = fullName; *p; ++p) { + if ((u32)*p >= 0x7f) { + *p = ' '; + } + } + return fullName; }