mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
port: sanitize controller names
because apparently some of them can't fucking resist putting a funny R or TM in there
This commit is contained in:
1 parent
ba1b6c3232
commit
d2d35263a4
1 file changed
+7
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user