diff options
author | Harsh Sharma <harsh.sharma@multitech.com> | 2020-01-10 15:02:23 -0600 |
---|---|---|
committer | Harsh Sharma <harsh.sharma@multitech.com> | 2020-01-10 15:02:23 -0600 |
commit | 03299da706c0f8b3a9fc8565d980a253eeab82e5 (patch) | |
tree | 60be759cea607dacbce48fb4572c8fa999480bf5 /src/Device/Device.cpp | |
parent | bfc20a0ee14c841c75eeb6878dc5e3eced7d8e2d (diff) | |
download | mts-io-sysfs-03299da706c0f8b3a9fc8565d980a253eeab82e5.tar.gz mts-io-sysfs-03299da706c0f8b3a9fc8565d980a253eeab82e5.tar.bz2 mts-io-sysfs-03299da706c0f8b3a9fc8565d980a253eeab82e5.zip |
Bug fix: device info list declaration and valid directory check
Diffstat (limited to 'src/Device/Device.cpp')
-rw-r--r-- | src/Device/Device.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp index 2498edd..4e449ab 100644 --- a/src/Device/Device.cpp +++ b/src/Device/Device.cpp @@ -35,8 +35,8 @@ std::map<std::string, bool> Device::capabilityList = {{"adc", false},{"battery", {"wifi", false}}; std::map<std::string, std::string> Device::deviceInfoList = {{"deviceId", ""},{"hardwareVersion", ""}, - {"imei", ""},{"macAddress", "00:00:00:00:00:00"},{"macBluetooth", "00:00:00:00:00:00"}, - {"macWifi", "00:00:00:00:00:00"},{"productId", ""},{"uuid", ""},{"vendorId", ""}}; + {"imei", ""},{"macAddress", "00:00:00:00:00:00"},{"macBluetooth", "00:00:00:00:00:00"}, + {"macWifi", "00:00:00:00:00:00"},{"productId", ""},{"uuid", ""},{"vendorId", ""}}; Device::Device() { isRoot = !getuid(); @@ -49,7 +49,7 @@ bool Device::isAccessoryCard(const char * d_name, const char * dir_name) { bool Device::isValidDirectory(const struct dirent * entry, std::string fullPath, const char * d_name) { std::string path = fullPath + "/" + std::string(d_name); - return (entry->d_type & DT_DIR) && strcmp (d_name, "..") != 0 && strcmp (d_name, ".") != 0 && (path.length() <= PATH_MAX); + return (entry->d_type & DT_DIR) && strcmp (d_name, "..") != 0 && strcmp (d_name, ".") != 0 && (path.length() < PATH_MAX); } void Device::getSystemTreeJson(const char * dir_name) { |