Skip to content

Undefined behavior on INT_MIN #118

@eyalroz

Description

@eyalroz

The library has undefined behavior in some cases, due to applying the unary negation operator indiscriminately. For example, when we print:

sprintf_(buffer, "%d", INT_MIN);

we internally have an int value variable with value INT_MIN, and then we take -value (or 0 - value). That's undefined! Not good.

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