fix: Fix misuse of atoi()

This commit is contained in:
Yang Hau 2022-09-28 08:36:00 +08:00 committed by Beat Küng
parent e2f3157ecb
commit 2dcde93d96
1 changed files with 1 additions and 1 deletions

View File

@ -321,7 +321,7 @@ GPS::GPS(const char *path, gps_driver_mode_t mode, GPSHelper::Interface interfac
set_device_bus_type(device::Device::DeviceBusType::DeviceBusType_SERIAL);
char c = _port[strlen(_port) - 1]; // last digit of path (eg /dev/ttyS2)
set_device_bus(atoi(&c));
set_device_bus(c - 48); // sub 48 to convert char to integer
} else if (_interface == GPSHelper::Interface::SPI) {
set_device_bus_type(device::Device::DeviceBusType::DeviceBusType_SPI);