Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b071a809 authored by Benoit Goby's avatar Benoit Goby Committed by Ruchi Kandoi
Browse files

usb: gadget: android: Fix product name



Product names may contain spaces and scanf %s only matches the 1st word.
Use strlcpy instead.

Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0
Signed-off-by: default avatarBenoit Goby <benoit@android.com>
parent 9c3b0609
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1053,10 +1053,7 @@ field ## _store(struct device *dev, struct device_attribute *attr, \
{									\
	if (size >= sizeof(buffer))					\
		return -EINVAL;						\
	if (sscanf(buf, "%s", buffer) == 1) {				\
		return size;						\
	}								\
	return -1;							\
	return strlcpy(buffer, buf, sizeof(buffer));			\
}									\
static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, field ## _show, field ## _store);