From 4256cc6728645f0d6a8ab92b845e6d642b9113be Mon Sep 17 00:00:00 2001 From: liqiao49 Date: Wed, 26 Jul 2023 19:32:03 +0800 Subject: [PATCH] 7777 Signed-off-by: liqiao49 --- services/state/src/dinput_state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/state/src/dinput_state.cpp b/services/state/src/dinput_state.cpp index 191adbe..bf773bf 100644 --- a/services/state/src/dinput_state.cpp +++ b/services/state/src/dinput_state.cpp @@ -169,7 +169,7 @@ void DInputState::CheckKeyboardState(std::string &dhid, std::string &keyboardNod DHLOGI("CheckKeyboardState enter, dhid %s, keyboardNodePath %s.", GetAnonyString(dhid).c_str(), keyboardNodePath.c_str()); char canonicalPath[PATH_MAX + 1] = {0x00}; - canonicalDevicePath[PATH_MAX] = '\0'; + canonicalPath[PATH_MAX] = '\0'; if (keyboardNodePath.length() == 0 || keyboardNodePath.length() >= PATH_MAX || realpath(keyboardNodePath.c_str(), canonicalPath) == nullptr) { DHLOGE("keyboard Nodepath check fail, error path: %s", keyboardNodePath.c_str()); @@ -210,7 +210,7 @@ void DInputState::CheckMouseKeyState(const int32_t &sessionId, const std::string DHLOGI("CheckMouseKeyState enter, mouseNodePath %s, mouseNodeDhId %s, sessionId %d.", mouseNodePath.c_str(), GetAnonyString(mouseNodeDhId).c_str(), sessionId); char canonicalPath[PATH_MAX + 1] = {0x00}; - canonicalDevicePath[PATH_MAX] = '\0'; + canonicalPath[PATH_MAX] = '\0'; if (mouseNodePath.length() == 0 || mouseNodePath.length() >= PATH_MAX || realpath(mouseNodePath.c_str(), canonicalPath) == nullptr) { DHLOGE("mouse Nodepath check fail, error path: %s", mouseNodePath.c_str());