diff -r c18d2951e8d7 -r 34da2d2b12d5 main/updates.c --- a/main/updates.c Tue Sep 26 14:59:06 2023 +0200 +++ b/main/updates.c Tue Sep 26 15:10:25 2023 +0200 @@ -103,7 +103,7 @@ esp_http_client_cleanup(client); goto updateerr; } - ESP_LOGI(TAG, "Update to partition subtype %d at offset 0x%x", update_partition->subtype, update_partition->address); + ESP_LOGI(TAG, "Update to partition subtype %d at offset 0x%lu", update_partition->subtype, update_partition->address); err = esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle); if (err != ESP_OK) { @@ -126,7 +126,7 @@ } else if (data_read > 0) { if (image_header_was_checked == false) { esp_app_desc_t new_app_info; - if (data_read > sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t) + sizeof(esp_app_desc_t)) { + if (data_read > (sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t) + sizeof(esp_app_desc_t))) { // check current version with downloading memcpy(&new_app_info, &ota_write_data[sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t)], sizeof(esp_app_desc_t));