Merge pull request #155 from i-jaffer/develop

[fix] fix byte alignment logic judgment error bug.
pull/157/head
朱天龙 (Armink) 3 years ago committed by GitHub
commit bee1918ebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -506,11 +506,11 @@ EfErrCode ef_log_read(size_t index, uint32_t *log, size_t size) {
return result; return result;
} }
if (size % 4 == 0) { if (size % 4 != 0) {
EF_DEBUG("Error: size must be word aligned."); EF_DEBUG("Error: size must be word aligned.");
return EF_READ_ERR; return EF_READ_ERR;
} }
if (index < cur_using_size) { if (index >= cur_using_size) {
EF_DEBUG("Error: index out of ranges, current using size is %d", cur_using_size); EF_DEBUG("Error: index out of ranges, current using size is %d", cur_using_size);
return EF_READ_ERR; return EF_READ_ERR;
} }

Loading…
Cancel
Save