[PATCH 11/11] winebus.sys: Accept whitespaces in strings parsed from uevent.
Rémi Bernon
rbernon at codeweavers.com
Fri Nov 12 02:49:47 CST 2021
From: Ivo Ivanov <logos128 at gmail.com>
Fixes the device names appearing with the first words in joy.cpl
and probably in games, when the UDEV bus is used in HIDRAW mode.
Signed-off-by: Ivo Ivanov <logos128 at gmail.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
dlls/winebus.sys/bus_udev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index dad5344a54c..5ff1719848d 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -1121,13 +1121,13 @@ static void get_device_subsystem_info(struct udev_device *dev, char const *subsy
if (!strncmp(ptr, "HID_UNIQ=", 9))
{
if (desc->serialnumber[0]) continue;
- if (sscanf(ptr, "HID_UNIQ=%256s\n", buffer) == 1)
+ if (sscanf(ptr, "HID_UNIQ=%256[^\n]", buffer) == 1)
ntdll_umbstowcs(buffer, strlen(buffer) + 1, desc->serialnumber, ARRAY_SIZE(desc->serialnumber));
}
if (!strncmp(ptr, "HID_NAME=", 9))
{
if (desc->product[0]) continue;
- if (sscanf(ptr, "HID_NAME=%256s\n", buffer) == 1)
+ if (sscanf(ptr, "HID_NAME=%256[^\n]", buffer) == 1)
ntdll_umbstowcs(buffer, strlen(buffer) + 1, desc->product, ARRAY_SIZE(desc->product));
}
if (!strncmp(ptr, "HID_PHYS=", 9) || !strncmp(ptr, "PHYS=\"", 6))
--
2.33.1
More information about the wine-devel
mailing list