Skip to content

Commit

Permalink
fix: static analysis for gt911
Browse files Browse the repository at this point in the history
  • Loading branch information
finger563 committed Jan 18, 2024
1 parent 8b83e10 commit d53b8fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/gt911/include/gt911.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ class Gt911 {
uint8_t d[d_len];
d[0] = reg_addr >> 8;
d[1] = reg_addr & 0xFF;
memcpy(&d[2], data, len);
if (len > 0 && data != nullptr)
memcpy(&d[2], data, len);
bool success = write_(address_, d, d_len);
if (!success) {
ec = std::make_error_code(std::errc::io_error);
Expand Down

0 comments on commit d53b8fc

Please sign in to comment.