* fixed issues (found during unit test)

This commit is contained in:
lumapu 2022-04-30 02:02:41 +02:00
parent 32e58c98c0
commit af4960f1c4
4 changed files with 30 additions and 20 deletions

View file

@ -2,7 +2,9 @@
#define __HM_SYSTEM_H__
#include "hmInverter.h"
#ifndef NO_RADIO
#include "hmRadio.h"
#endif
@ -34,7 +36,8 @@ class HmSystem {
p->id = mNumInv;
p->serial.u64 = serial;
p->type = type;
uint8_t len = strlen(name);
p->init();
uint8_t len = (uint8_t)strlen(name);
strncpy(p->name, name, (len > MAX_NAME_LENGTH) ? MAX_NAME_LENGTH : len);
if(NULL == p->assign) {