armink / EasyFlash

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

The write function should not be called when the log remaining length is 0 #153

Open childerxxx opened 1 year ago

childerxxx commented 1 year ago

Hi armink,

It's better to add a "remaining length" check before this line. https://github.com/armink/EasyFlash/blob/f732982f71c015def3d5a84e72abcd4411ca1d9b/easyflash/src/ef_log.c#L681

For example: if (size - write_size == 0), then we should not call the ef_port_write() function.

I raised an issue to confirm whether it really needs to be modified or my usage method is wrong.

Looking forward to your reply.