Skip to content

Commit

Permalink
Fix high rated bugs reported by pio check
Browse files Browse the repository at this point in the history
  • Loading branch information
InuSasha committed Oct 19, 2023
1 parent 77c113c commit b392e9e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/DisplayManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ bool DisplayManager_::generateNotification(uint8_t source, const char *json)
newNotification.repeat = doc.containsKey("repeat") ? doc["repeat"].as<int>() : -1;
newNotification.fade = doc.containsKey("fadeText") ? doc["fadeText"].as<int>() : 0;
newNotification.blink = doc.containsKey("blinkText") ? doc["blinkText"].as<int>() : 0;
newNotification.barSize = 0;
newNotification.lineSize = 0;
if (newNotification.noScrolling)
{
newNotification.repeat = -1;
Expand Down
2 changes: 1 addition & 1 deletion src/Functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ uint32_t getColorFromJsonVariant(JsonVariant colorVariant, uint32_t defaultColor
uint8_t s = colorArray[2];
uint8_t v = colorArray[3];
// Assuming you have a function to convert HSV to RGB
uint8_t r, g, b;
uint8_t r = 0, g = 0, b = 0;
// hsv2rgb(h, s, v, r, g, b);
return (r << 16) | (g << 8) | b; // Ignoring alpha channel
}
Expand Down
4 changes: 2 additions & 2 deletions src/MQTTManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ void MQTTManager_::setup()
mqtt.setDataPrefix(MQTT_PREFIX.c_str());
uint8_t mac[6];
WiFi.macAddress(mac);
char *macStr = new char[18 + 1];
snprintf(macStr, 24, "%02x%02x%02x", mac[3], mac[4], mac[5]);
char macStr[7];
snprintf(macStr, 7, "%02x%02x%02x", mac[3], mac[4], mac[5]);
device.setUniqueId(mac, sizeof(mac));
device.setName(uniqueID);
device.setSoftwareVersion(VERSION);
Expand Down

0 comments on commit b392e9e

Please sign in to comment.