diff --git a/components/libraries/fds/fds.c b/components/libraries/fds/fds.c index 99ddc66..269792a 100644 --- a/components/libraries/fds/fds.c +++ b/components/libraries/fds/fds.c @@ -246,7 +246,7 @@ static bool page_has_space(uint16_t page, uint16_t length_words) { length_words += m_pages[page].write_offset; length_words += m_pages[page].words_reserved; - return (length_words < FDS_PAGE_SIZE); + return (length_words <= FDS_PAGE_SIZE); } @@ -367,7 +367,7 @@ static ret_code_t write_space_reserve(uint16_t length_words, uint16_t * p_page) bool space_reserved = false; uint16_t const total_len_words = length_words + FDS_HEADER_SIZE; - if (total_len_words >= FDS_PAGE_SIZE - FDS_PAGE_TAG_SIZE) + if (total_len_words > FDS_PAGE_SIZE - FDS_PAGE_TAG_SIZE) { return FDS_ERR_RECORD_TOO_LARGE; }