From 03299da706c0f8b3a9fc8565d980a253eeab82e5 Mon Sep 17 00:00:00 2001 From: Harsh Sharma Date: Fri, 10 Jan 2020 15:02:23 -0600 Subject: Bug fix: device info list declaration and valid directory check --- src/Device/Device.cpp | 6 +++--- src/Version.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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 Device::capabilityList = {{"adc", false},{"battery", {"wifi", false}}; std::map 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) { diff --git a/src/Version.cpp b/src/Version.cpp index b963c93..b601c9d 100644 --- a/src/Version.cpp +++ b/src/Version.cpp @@ -1,4 +1,4 @@ //Pre-Build Auto-Generated Source #include "Version.h" -const std::string Version::version("v1.0.0-10-gb69c751"); +const std::string Version::version("v1.0.0-11-gbfc20a0"); -- cgit v1.2.3