Skip to content

[clang-tidy] Check request: modernize-use-stoi-instead-atoi #121174

@denzor200

Description

@denzor200
std::string str = "42";
int a = std::atoi(str.c_str()); // INCORRECT
int b = std::stoi(str); //  OK

Since std::atoi is ancient and might produce bugs in overflow cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions