forked from suyu/suyu
cmd/yuzu: Remove uncaught usage of stoi
Also fixes a style inconsistency
This commit is contained in:
parent
5ffa1049ae
commit
c2961454fe
1 changed files with 3 additions and 2 deletions
|
@ -264,8 +264,9 @@ int main(int argc, char** argv) {
|
||||||
nickname = match[1];
|
nickname = match[1];
|
||||||
password = match[2];
|
password = match[2];
|
||||||
address = match[3];
|
address = match[3];
|
||||||
if (!match[4].str().empty())
|
if (!match[4].str().empty()) {
|
||||||
port = static_cast<u16>(std::stoi(match[4]));
|
port = static_cast<u16>(std::strtoul(match[4].str().c_str(), nullptr, 0));
|
||||||
|
}
|
||||||
std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$");
|
std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$");
|
||||||
if (!std::regex_match(nickname, nickname_re)) {
|
if (!std::regex_match(nickname, nickname_re)) {
|
||||||
std::cout
|
std::cout
|
||||||
|
|
Loading…
Reference in a new issue