[APRS] Fix array length calculation in static only mode

This commit is contained in:
jgromes 2023-10-18 17:47:09 +02:00
parent 46bf0445fa
commit eabc752703

View file

@ -35,7 +35,6 @@ int16_t APRSClient::begin(char sym, char* callsign, uint8_t ssid, bool alt) {
}
int16_t APRSClient::sendPosition(char* destCallsign, uint8_t destSSID, char* lat, char* lon, char* msg, char* time) {
#if !defined(RADIOLIB_STATIC_ONLY)
size_t len = 1 + strlen(lat) + 1 + strlen(lon);
if(msg != NULL) {
len += 1 + strlen(msg);
@ -43,6 +42,7 @@ int16_t APRSClient::sendPosition(char* destCallsign, uint8_t destSSID, char* lat
if(time != NULL) {
len += strlen(time);
}
#if !defined(RADIOLIB_STATIC_ONLY)
char* info = new char[len + 1];
#else
char info[RADIOLIB_STATIC_ARRAY_SIZE];