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

Skip to content
Commit b8863f6a authored by Avichal Rakesh's avatar Avichal Rakesh
Browse files

camera: Fix prefix length path for External Camera HAL

The default External Camera HAL accidentally used `sizeof` on a `char *`
to get the length of the string. This "worked" because the string in
question "/dev/" has length of 5, while on a 32-bit system `char *`
has a size of 4. This difference of 1 was handled a few lines later.

However on 64-bit system `sizeof(char *)` returns 8 which breaks the
logic later in code.

As `sizeof` was being used as a proxy for strlen, this CL converts the
uses C++'s std::char_traits::length to determine the string lengths
at compile time.

Bug: 265168485
Test: Manually tested that the calculated length is correct after the
      fix.
Change-Id: I92481a2bcb74fdbbb483ef552168debf07b2d68a
parent 9efd5025
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment