Skip to content

Part 5: page_num out of bounds #102

@duncanchiu409

Description

@duncanchiu409

If page_num start from 0 to TABLE_MAX_PAGE - 1, not 1, the if statement should be this instead. Tell me if I am right or wrong.

void* get_page(Pager* pager, uint32_t page_number){
    if(page_number >= TABLE_MAX_PAGES){
        printf("Tried to fetch page number out of bounds. %d > %d\n", page_number, TABLE_MAX_PAGES);
        exit(EXIT_FAILURE);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions