[APRS] Fix array length calculation in static only mode
This commit is contained in:
parent
46bf0445fa
commit
eabc752703
1 changed files with 7 additions and 7 deletions
|
@ -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) {
|
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);
|
size_t len = 1 + strlen(lat) + 1 + strlen(lon);
|
||||||
if(msg != NULL) {
|
if(msg != NULL) {
|
||||||
len += 1 + strlen(msg);
|
len += 1 + strlen(msg);
|
||||||
|
@ -43,6 +42,7 @@ int16_t APRSClient::sendPosition(char* destCallsign, uint8_t destSSID, char* lat
|
||||||
if(time != NULL) {
|
if(time != NULL) {
|
||||||
len += strlen(time);
|
len += strlen(time);
|
||||||
}
|
}
|
||||||
|
#if !defined(RADIOLIB_STATIC_ONLY)
|
||||||
char* info = new char[len + 1];
|
char* info = new char[len + 1];
|
||||||
#else
|
#else
|
||||||
char info[RADIOLIB_STATIC_ARRAY_SIZE];
|
char info[RADIOLIB_STATIC_ARRAY_SIZE];
|
||||||
|
|
Loading…
Add table
Reference in a new issue