Fix project version longer than 30 characters breaking compilation (#6535)

This commit is contained in:
Jesse Hills
2024-04-15 12:02:19 +12:00
parent ff0d33ffe3
commit ed02747ebc
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ class ProjectUpdateTrigger : public Trigger<std::string>, public Component {
uint32_t hash = fnv1_hash(ESPHOME_PROJECT_NAME);
ESPPreferenceObject pref = global_preferences->make_preference<char[30]>(hash, true);
char previous_version[30];
char current_version[30] = ESPHOME_PROJECT_VERSION;
char current_version[30] = ESPHOME_PROJECT_VERSION_30;
if (pref.load(&previous_version)) {
int cmp = strcmp(previous_version, current_version);
if (cmp < 0) {