diff --git a/libraries/AP_HAL/SIMState.h b/libraries/AP_HAL/SIMState.h index 4c8350371a..50589eb85a 100644 --- a/libraries/AP_HAL/SIMState.h +++ b/libraries/AP_HAL/SIMState.h @@ -44,7 +44,7 @@ #include #include -#include +#include #include @@ -93,7 +93,7 @@ private: uint32_t _update_count; #if CONFIG_HAL_BOARD == HAL_BOARD_SITL - SocketAPM _sitl_rc_in{true}; + SocketAPM_native _sitl_rc_in{true}; #endif SITL::SIM *_sitl; uint16_t _rcin_port; @@ -220,7 +220,7 @@ private: #if CONFIG_HAL_BOARD == HAL_BOARD_SITL // output socket for flightgear viewing - SocketAPM fg_socket{true}; + SocketAPM_native fg_socket{true}; #endif const char *defaults_path = HAL_PARAM_DEFAULTS_PATH; diff --git a/libraries/AP_HAL/utility/Socket.cpp b/libraries/AP_HAL/utility/Socket.cpp index 2c33462b55..ccb8cb3f39 100644 --- a/libraries/AP_HAL/utility/Socket.cpp +++ b/libraries/AP_HAL/utility/Socket.cpp @@ -358,6 +358,7 @@ ssize_t SOCKET_CLASS_NAME::recv(void *buf, size_t size, uint32_t timeout_ms) */ void SOCKET_CLASS_NAME::last_recv_address(const char *&ip_addr, uint16_t &port) const { + // 16 bytes for aaa.bbb.ccc.ddd with null term static char buf[16]; auto *str = last_recv_address(buf, sizeof(buf), port); ip_addr = str;