Skip to content

Fix logging snprintf with negative time values #4556

@tarek-y-ismail

Description

@tarek-y-ismail

snprintf(str, sizeof str, "%lld (%lld.%06lldms ago)",
when_ns, age_ns / 1000000LL, age_ns % 1000000LL);

The reminder operator preserves the sign age_ns is negative (saw it a couple of times when debugging), so the output can looks something like -1.-500000ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions