Skip to content

Panic in get_int if nbytes is zero #798

@somtochiama

Description

@somtochiama

get_int panics if nbytes is zero due to attempt to right shift by 64 when doing the sign extension.

    let mut buf = &b"hello world"[..];
    let ret1 = buf.get_int(0);

Not sure if this is the intended behaviour that isn't documented. Doing the same with get_uint returns zero which might be preferrable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions