Skip to content

![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) #34

@EddyTheCo

Description

@EddyTheCo

medium

std::localtime is not thread-safe as it returns a pointer to a static internal buffer. In a multi-threaded environment like this library, you should use localtime_r (on POSIX) to ensure thread safety.

    std::tm tm_buf;
    localtime_r(&time_value, &tm_buf);
    ost << std::put_time(&tm_buf, "%Y-%m-%d %H:%M:%S")

Originally posted by @gemini-code-assist[bot] in #33 (comment)

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