Browse Source

AP_RangeFinder: LightwareSerial uses nullptr for strtof

zr-v5.1
Randy Mackay 5 years ago
parent
commit
429e70fb94
  1. 2
      libraries/AP_RangeFinder/AP_RangeFinder_LightWareSerial.cpp

2
libraries/AP_RangeFinder/AP_RangeFinder_LightWareSerial.cpp

@ -43,7 +43,7 @@ bool AP_RangeFinder_LightWareSerial::get_reading(uint16_t &reading_cm) @@ -43,7 +43,7 @@ bool AP_RangeFinder_LightWareSerial::get_reading(uint16_t &reading_cm)
if (protocol_state == ProtocolState::UNKNOWN || protocol_state == ProtocolState::LEGACY) {
if (c == '\r') {
linebuf[linebuf_len] = 0;
const float dist = strtof(linebuf, NULL);
const float dist = strtof(linebuf, nullptr);
if (!is_negative(dist)) {
sum += dist;
valid_count++;

Loading…
Cancel
Save