@@ -230,16 +230,16 @@ bool UpdaterClass::end(bool evenIfRemaining){
230
230
// If expectedSigLen is non-zero, we expect the last four bytes of the buffer to
231
231
// contain a matching length field, preceded by the bytes of the signature itself.
232
232
// But if expectedSigLen is zero, we expect neither a signature nor a length field;
233
- static constexpr uint32_t sigSize = 4 ;
233
+ static constexpr uint32_t SigSize = sizeof ( uint32_t ) ;
234
234
const uint32_t expectedSigLen = _verify->length ();
235
- const uint32_t sigLenAddr = _startAddress + _size - sigSize ;
235
+ const uint32_t sigLenAddr = _startAddress + _size - SigSize ;
236
236
uint32_t sigLen = 0 ;
237
237
238
238
#ifdef DEBUG_UPDATER
239
239
DEBUG_UPDATER.printf_P (PSTR (" [Updater] expected sigLen: %lu\n " ), expectedSigLen);
240
240
#endif
241
241
if (expectedSigLen > 0 ) {
242
- ESP.flashRead (sigLenAddr, &sigLen, sigSize );
242
+ ESP.flashRead (sigLenAddr, &sigLen, SigSize );
243
243
#ifdef DEBUG_UPDATER
244
244
DEBUG_UPDATER.printf_P (PSTR (" [Updater] sigLen from flash: %lu\n " ), sigLen);
245
245
#endif
@@ -253,12 +253,12 @@ bool UpdaterClass::end(bool evenIfRemaining){
253
253
254
254
auto binSize = _size;
255
255
if (expectedSigLen > 0 ) {
256
- if (binSize < (sigLen + sigSize )) {
256
+ if (binSize < (sigLen + SigSize )) {
257
257
_setError (UPDATE_ERROR_SIGN);
258
258
_reset ();
259
259
return false ;
260
260
}
261
- binSize -= (sigLen + sigSize );
261
+ binSize -= (sigLen + SigSize );
262
262
#ifdef DEBUG_UPDATER
263
263
DEBUG_UPDATER.printf_P (PSTR (" [Updater] Adjusted size (without the signature and sigLen): %lu\n " ), binSize);
264
264
#endif
0 commit comments