1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

EEPROM: round requested size to 4 byte boundary (#659)

This commit is contained in:
Ivan Grokhotkov 2015-08-05 09:00:17 -04:00
parent 3a3f25997c
commit afd0ca23a0

View File

@ -44,6 +44,8 @@ void EEPROMClass::begin(size_t size) {
if (size > SPI_FLASH_SEC_SIZE) if (size > SPI_FLASH_SEC_SIZE)
size = SPI_FLASH_SEC_SIZE; size = SPI_FLASH_SEC_SIZE;
size = (size + 3) & (~3);
if (_data) { if (_data) {
delete[] _data; delete[] _data;
} }