armink / EasyFlash

Lightweight IoT device information storage solution: KV/IAP/LOG. | 轻量级物联网设备信息存储方案:参数存储、在线升级及日志存储 ,全新一代版本请移步至 https://github.com/armink/FlashDB
MIT License
1.99k stars 760 forks source link

ef_log_read word aligned 判断错误 #150

Open vince025 opened 1 year ago

vince025 commented 1 year ago

EfErrCode ef_log_read(size_t index, uint32_t *log, size_t size) 里 if (size % 4 == 0) { EF_DEBUG("Error: size must be word aligned."); return EF_READ_ERR; } 应该改为 if (size % 4 != 0) { EF_DEBUG("Error: size must be word aligned."); return EF_READ_ERR; }

vince025 commented 1 year ago

同样的: if (index < cur_using_size) { 也要更改为: if (index >= cur_using_size) {

SnowSakuraKo commented 1 year ago

遇到了相同的报错