Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91515788 authored by Avichal Rakesh's avatar Avichal Rakesh
Browse files

External Camera HAL: Fix prefix length

The length calulation for the string "/dev/video" accidentally added one
instead of removing one for null terminated string. This CL fixes the
misplaced sign to get the correct length.

Test: Manually Tested that the length is correct.
Change-Id: I3e5d0cd7df20afdb2db61ac0963c5580722d8b24
parent 740c2560
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ const int kMaxDevicePathLen = 256;
constexpr char kDevicePath[] = "/dev/";
constexpr char kDevicePath[] = "/dev/";
constexpr char kPrefix[] = "video";
constexpr char kPrefix[] = "video";
constexpr int kPrefixLen = sizeof(kPrefix) - 1;
constexpr int kPrefixLen = sizeof(kPrefix) - 1;
constexpr int kDevicePrefixLen = sizeof(kDevicePath) + kPrefixLen + 1;
constexpr int kDevicePrefixLen = sizeof(kDevicePath) + kPrefixLen - 1;


bool matchDeviceName(int cameraIdOffset, const std::string& deviceName, std::string* deviceVersion,
bool matchDeviceName(int cameraIdOffset, const std::string& deviceName, std::string* deviceVersion,
                     std::string* cameraDevicePath) {
                     std::string* cameraDevicePath) {