OSDN Git Service

kbdsensor: fix parsing of input device name nougat-x86
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 17 Mar 2022 09:25:27 +0000 (17:25 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 17 Mar 2022 09:25:27 +0000 (17:25 +0800)
commiteebd90ddf096a53cb5798a574fb2684d74b00e5f
tree0050ec8263d6d4f12b35eef614601e6f8ea05601
parent168c15b9a7e045eeaa24a9dcfd61ee9ec364410d
kbdsensor: fix parsing of input device name

Originally we use %s in sscanf to get the device name from the property.
However, %s only matches a sequence of non-white-space characters. That
means if the name contains space characters, it can't be parsed correctly.

The patch uses strsep to extract the substring before the first delimiter
as the device name.
kbdsensor.cpp