Skip to content

Commit

Permalink
AP_RangeFinder: Change numeric and hexadecimal number determination t…
Browse files Browse the repository at this point in the history
…o standard methods
  • Loading branch information
muramura authored and peterbarker committed Sep 12, 2024
1 parent b878d56 commit 717b9d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/AP_RangeFinder/AP_RangeFinder_LightWareI2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#if AP_RANGEFINDER_LWI2C_ENABLED

#include <ctype.h>

#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/utility/sparse-endian.h>

Expand Down Expand Up @@ -431,9 +433,7 @@ bool AP_RangeFinder_LightWareI2C::sf20_parse_stream(uint8_t *stream_buf,
bool number_found = false;
uint16_t accumulator = 0;
uint16_t digit_u16 = (uint16_t)stream_buf[*p_num_processed_chars];
while ((((digit_u16 <= '9') &&
(digit_u16 >= '0')) ||
(digit_u16 == '.')) &&
while ((isdigit(digit_u16) || (digit_u16 == '.')) &&
(*p_num_processed_chars < lx20_max_reply_len_bytes)) {
(*p_num_processed_chars)++;
if (decrement_multiplier) {
Expand Down

0 comments on commit 717b9d1

Please sign in to comment.