diff options
| author | 2023-07-16 18:55:27 -0400 | |
|---|---|---|
| committer | 2023-08-08 11:09:37 -0400 | |
| commit | 83eee1d2266a1de374be0a8b2c0f2827f5e25bcf (patch) | |
| tree | 7dfbdfb32b6671a79f433c3cb59acc7ba0e5cc9c /src/core/hle/service/sockets | |
| parent | core: remove ResultVal type (diff) | |
| download | yuzu-83eee1d2266a1de374be0a8b2c0f2827f5e25bcf.tar.gz yuzu-83eee1d2266a1de374be0a8b2c0f2827f5e25bcf.tar.xz yuzu-83eee1d2266a1de374be0a8b2c0f2827f5e25bcf.zip | |
ssl: remove ResultVal use
Diffstat (limited to 'src/core/hle/service/sockets')
| -rw-r--r-- | src/core/hle/service/sockets/nsd.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/hle/service/sockets/nsd.cpp b/src/core/hle/service/sockets/nsd.cpp index 5dfcaabb1..bac21752a 100644 --- a/src/core/hle/service/sockets/nsd.cpp +++ b/src/core/hle/service/sockets/nsd.cpp | |||
| @@ -54,7 +54,7 @@ NSD::NSD(Core::System& system_, const char* name) : ServiceFramework{system_, na | |||
| 54 | RegisterHandlers(functions); | 54 | RegisterHandlers(functions); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | static ResultVal<std::string> ResolveImpl(const std::string& fqdn_in) { | 57 | static std::string ResolveImpl(const std::string& fqdn_in) { |
| 58 | // The real implementation makes various substitutions. | 58 | // The real implementation makes various substitutions. |
| 59 | // For now we just return the string as-is, which is good enough when not | 59 | // For now we just return the string as-is, which is good enough when not |
| 60 | // connecting to real Nintendo servers. | 60 | // connecting to real Nintendo servers. |
| @@ -64,13 +64,10 @@ static ResultVal<std::string> ResolveImpl(const std::string& fqdn_in) { | |||
| 64 | 64 | ||
| 65 | static Result ResolveCommon(const std::string& fqdn_in, std::array<char, 0x100>& fqdn_out) { | 65 | static Result ResolveCommon(const std::string& fqdn_in, std::array<char, 0x100>& fqdn_out) { |
| 66 | const auto res = ResolveImpl(fqdn_in); | 66 | const auto res = ResolveImpl(fqdn_in); |
| 67 | if (res.Failed()) { | 67 | if (res.size() >= fqdn_out.size()) { |
| 68 | return res.Code(); | ||
| 69 | } | ||
| 70 | if (res->size() >= fqdn_out.size()) { | ||
| 71 | return ResultOverflow; | 68 | return ResultOverflow; |
| 72 | } | 69 | } |
| 73 | std::memcpy(fqdn_out.data(), res->c_str(), res->size() + 1); | 70 | std::memcpy(fqdn_out.data(), res.c_str(), res.size() + 1); |
| 74 | return ResultSuccess; | 71 | return ResultSuccess; |
| 75 | } | 72 | } |
| 76 | 73 | ||