mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
lint warnings
This commit is contained in:
@@ -220,7 +220,7 @@ const char * Command::return_code_string(const uint8_t return_code) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
static char s[4];
|
||||
static char s[4]; // static to avoid allocation on each call and loosing scope
|
||||
return Helpers::smallitoa(s, return_code);
|
||||
}
|
||||
|
||||
|
||||
@@ -586,7 +586,7 @@ void EMSdevice::add_device_value(int8_t tag, // to b
|
||||
if ((entityCustomization.product_id == product_id()) && (entityCustomization.device_id == device_id())) {
|
||||
char entity[70];
|
||||
if (tag < DeviceValueTAG::TAG_HC1) {
|
||||
strncpy(entity, short_name, sizeof(entity));
|
||||
strncpy(entity, short_name, sizeof(entity)-1);
|
||||
} else {
|
||||
snprintf(entity, sizeof(entity), "%s/%s", tag_to_mqtt(tag), short_name);
|
||||
}
|
||||
@@ -1201,7 +1201,7 @@ void EMSdevice::setCustomizationEntity(const std::string & entity_id) {
|
||||
for (auto & dv : devicevalues_) {
|
||||
char entity_name[70];
|
||||
if (dv.tag < DeviceValueTAG::TAG_HC1) {
|
||||
strncpy(entity_name, dv.short_name, sizeof(entity_name));
|
||||
strncpy(entity_name, dv.short_name, sizeof(entity_name)-1);
|
||||
} else {
|
||||
snprintf(entity_name, sizeof(entity_name), "%s/%s", tag_to_mqtt(dv.tag), dv.short_name);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ class EMSdevice {
|
||||
}
|
||||
|
||||
void has_update(char * value, const char * newvalue, size_t len) {
|
||||
if (strcmp(value, newvalue) != 0) {
|
||||
if (value && strcmp(value, newvalue) != 0) {
|
||||
strlcpy(value, newvalue, len);
|
||||
has_update_ = true;
|
||||
publish_value(value);
|
||||
|
||||
@@ -1211,7 +1211,9 @@ void Boiler::process_UBAFactory(std::shared_ptr<const Telegram> telegram) {
|
||||
return;
|
||||
}
|
||||
toggle_fetch(telegram->type_id, false); // only read once
|
||||
uint8_t min, max, nomPower;
|
||||
uint8_t min = 0;
|
||||
uint8_t max = 0;
|
||||
uint8_t nomPower = 0;
|
||||
telegram->read_value(nomPower, 4);
|
||||
telegram->read_value(min, 5);
|
||||
telegram->read_value(max, 6);
|
||||
@@ -1777,7 +1779,9 @@ void Boiler::process_UBAOutdoorTemp(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// UBASetPoint 0x1A
|
||||
void Boiler::process_UBASetPoints(std::shared_ptr<const Telegram> telegram) {
|
||||
uint8_t setFlowTemp_, setBurnPow_, wwSetBurnPow_;
|
||||
uint8_t setFlowTemp_ = 0;
|
||||
uint8_t setBurnPow_ = 0;
|
||||
uint8_t wwSetBurnPow_ = 0;
|
||||
telegram->read_value(setFlowTemp_, 0);
|
||||
telegram->read_value(setBurnPow_, 1);
|
||||
telegram->read_value(wwSetBurnPow_, 2);
|
||||
@@ -2936,7 +2940,7 @@ bool Boiler::set_HpInLogic(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
char option[] = {"xxxxxxxxxxxxxxx"};
|
||||
strncpy(option, value, strlen(value)); // copy without termination
|
||||
strncpy(option, value, strlen(option)); // copy without termination
|
||||
// inputs 1,2,3 <inv>[<evu1><evu2><evu3><comp><aux><cool><heat><dhw><pv><prot><pres><mod>]
|
||||
if (id < 4) {
|
||||
uint8_t index[] = {0, 3, 6, 9, 12, 15, 18, 21, 24, 39, 36, 30};
|
||||
|
||||
Reference in New Issue
Block a user