Skip to content

Avoid using u32 parameters when they are cast to c_int #21

@nullsauce

Description

@nullsauce

In some instances (ex Parameters.set_width(&mut self, value: u32)) we pass a value as u32 but the value is immediately cast into c_int. Passing u32 values bigger than 2^31 will probably create an unexpected behavior. These parameters should therefore be declared as i32 or the function should be changed to use try_into() and return a result if the former doesn't make sense.

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