summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar lat9nq2023-09-13 13:36:09 -0400
committerGravatar lat9nq2023-09-13 13:52:09 -0400
commitc2961454fe006265454448ecce3f0a34834ec691 (patch)
tree6600657b428d2f9a3f1ae72bffec187f8d8a8a89 /src
parentcmd/config: Remove uncaught usage of stoul (diff)
downloadyuzu-c2961454fe006265454448ecce3f0a34834ec691.tar.gz
yuzu-c2961454fe006265454448ecce3f0a34834ec691.tar.xz
yuzu-c2961454fe006265454448ecce3f0a34834ec691.zip
cmd/yuzu: Remove uncaught usage of stoi
Also fixes a style inconsistency
Diffstat (limited to 'src')
-rw-r--r--src/yuzu_cmd/yuzu.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 55d0938f7..087cfaa26 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -264,8 +264,9 @@ int main(int argc, char** argv) {
264 nickname = match[1]; 264 nickname = match[1];
265 password = match[2]; 265 password = match[2];
266 address = match[3]; 266 address = match[3];
267 if (!match[4].str().empty()) 267 if (!match[4].str().empty()) {
268 port = static_cast<u16>(std::stoi(match[4])); 268 port = static_cast<u16>(std::strtoul(match[4].str().c_str(), nullptr, 0));
269 }
269 std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$"); 270 std::regex nickname_re("^[a-zA-Z0-9._\\- ]+$");
270 if (!std::regex_match(nickname, nickname_re)) { 271 if (!std::regex_match(nickname, nickname_re)) {
271 std::cout 272 std::cout