osrf / ros2_serial_example

61 stars 14 forks source link

Some fixes pointed out by clang-tidy. #28

Closed clalancette closed 5 years ago

clalancette commented 5 years ago
  1. Fix a bug where we were forgetting to check the return value of peek, meaning we could have tried to dereference a nullptr.
  2. Be explicit about boolean checks.
  3. Use a unique_ptr for the read_thread data to ensure that it is a heap allocation.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org