Skip to content
Snippets Groups Projects
Commit c2961454 authored by lat9nq's avatar lat9nq
Browse files

cmd/yuzu: Remove uncaught usage of stoi

Also fixes a style inconsistency
parent 5ffa1049
No related branches found
No related tags found
No related merge requests found
......@@ -264,8 +264,9 @@ int main(int argc, char** argv) {
nickname = match[1];
password = match[2];
address = match[3];
if (!match[4].str().empty())
port = static_cast<u16>(std::stoi(match[4]));
if (!match[4].str().empty()) {
port = static_cast<u16>(std::strtoul(match[4].str().c_str(), nullptr, 0));
}
std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$");
if (!std::regex_match(nickname, nickname_re)) {
std::cout
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment