diff --git a/src/memory/page.c b/src/memory/page.c index c8c32d2..5acdb47 100644 --- a/src/memory/page.c +++ b/src/memory/page.c @@ -17,7 +17,7 @@ static int16_t find_next_block(size_t nb_pages, uint16_t *pd_index_ptr, } *page_table_ptr = (uint32_t *)GET_PAGE_ADDR(0, *pd_index_ptr + PT_START); - for (uint16_t i = 0; i + nb_pages < PT_SIZE; i++) { + for (uint16_t i = 0; i + nb_pages - 1 < PT_SIZE; i++) { uint16_t j; for (j = 0; (*page_table_ptr)[i + j] >> 12 == i + j && j < nb_pages;