[RTTY] Fixed dynamic memory issue with ITA2Strings (#278)

This commit is contained in:
jgromes 2021-04-14 19:24:03 +02:00
parent 86ca714d00
commit 99386beec7
2 changed files with 3 additions and 1 deletions

View file

@ -3,12 +3,14 @@
ITA2String::ITA2String(char c) {
_len = 1;
_str = new char[1];
_str[0] = c;
_ita2Len = 0;
}
ITA2String::ITA2String(const char* str) {
_len = strlen(str);
_str = new char[_len];
strcpy(_str, str);
_ita2Len = 0;
}

View file

@ -67,7 +67,7 @@ class ITA2String {
#ifdef RADIOLIB_STATIC_ONLY
char _str[RADIOLIB_STATIC_ARRAY_SIZE];
#else
char* _str = new char[1];
char* _str;
#endif
size_t _len;
size_t _ita2Len;