提交 6236dfaa 编写于 作者: M Márton Németh 提交者: Dmitry Torokhov

Input: do not overwrite the first part of phys string

Use strlcat() to append a string to the previously created first part.
Signed-off-by: NMárton Németh <nm127@freemail.hu>
Acked-by: NJiri Kosina <jkosina@suse.cz>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 52ce4eaa
...@@ -266,7 +266,7 @@ static int usb_kbd_probe(struct usb_interface *iface, ...@@ -266,7 +266,7 @@ static int usb_kbd_probe(struct usb_interface *iface,
le16_to_cpu(dev->descriptor.idProduct)); le16_to_cpu(dev->descriptor.idProduct));
usb_make_path(dev, kbd->phys, sizeof(kbd->phys)); usb_make_path(dev, kbd->phys, sizeof(kbd->phys));
strlcpy(kbd->phys, "/input0", sizeof(kbd->phys)); strlcat(kbd->phys, "/input0", sizeof(kbd->phys));
input_dev->name = kbd->name; input_dev->name = kbd->name;
input_dev->phys = kbd->phys; input_dev->phys = kbd->phys;
......
...@@ -766,7 +766,7 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de ...@@ -766,7 +766,7 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de
ati_remote->interface = interface; ati_remote->interface = interface;
usb_make_path(udev, ati_remote->phys, sizeof(ati_remote->phys)); usb_make_path(udev, ati_remote->phys, sizeof(ati_remote->phys));
strlcpy(ati_remote->phys, "/input0", sizeof(ati_remote->phys)); strlcat(ati_remote->phys, "/input0", sizeof(ati_remote->phys));
if (udev->manufacturer) if (udev->manufacturer)
strlcpy(ati_remote->name, udev->manufacturer, sizeof(ati_remote->name)); strlcpy(ati_remote->name, udev->manufacturer, sizeof(ati_remote->name));
......
...@@ -338,7 +338,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i ...@@ -338,7 +338,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
pm->input = input_dev; pm->input = input_dev;
usb_make_path(udev, pm->phys, sizeof(pm->phys)); usb_make_path(udev, pm->phys, sizeof(pm->phys));
strlcpy(pm->phys, "/input0", sizeof(pm->phys)); strlcat(pm->phys, "/input0", sizeof(pm->phys));
spin_lock_init(&pm->lock); spin_lock_init(&pm->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册