mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-20 21:41:02 -04:00
@@ -327,8 +327,8 @@ void StringSplitToVector(const std::string& str, const char split, std::vector<s
|
||||
int OpenInputDeviceFdByPath(std::string devicePath)
|
||||
{
|
||||
chmod(devicePath.c_str(), S_IWRITE | S_IREAD);
|
||||
char* canonicalDevicePath = new char(PATH_MAX);
|
||||
if (devicePath.length() == 0 || devicePath.length() > PATH_MAX ||
|
||||
char canonicalDevicePath[PATH_MAX] = {0x00};
|
||||
if (devicePath.length() == 0 || devicePath.length() >= PATH_MAX ||
|
||||
realpath(devicePath.c_str(), canonicalDevicePath) == nullptr) {
|
||||
DHLOGE("path check fail, error path: %s", devicePath.c_str());
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user