Skip to content

Commit

Permalink
Initialize _ota variables inside begin function
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Oct 16, 2023
1 parent 9211abe commit 2f84091
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Arduino_ESP32_OTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ Arduino_ESP32_OTA::Error Arduino_ESP32_OTA::begin()

/* ... initialize CRC ... */
_crc32 = 0xFFFFFFFF;

/* initialize private variables */
_ota_size = 0;
_ota_header = {0};

if(!Update.begin(UPDATE_SIZE_UNKNOWN)) {
DEBUG_ERROR("%s: failed to initialize flash update", __FUNCTION__);
Expand Down

0 comments on commit 2f84091

Please sign in to comment.