Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

mark.c: 2 * bad array index ? #4

Description

@dcb314

[mark.c:31] -> [mark.c:29]: (warning) Array 'marks[10]' accessed at index 10, which is out of bounds. Otherwise condition 'mark_number<=10' is redundant.

if(mark_number <= MAX_MARK)
{
    marks[mark_number] = pos;
}

Maybe better code

if(mark_number < MAX_MARK)
{
    marks[mark_number] = pos;
}

[mark.c:51] -> [mark.c:49]: (warning) Array 'marks[10]' accessed at index 10, which is out of bounds. Otherwise condition 'mark_number<=10' is redundant.

Duplicate.

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