summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-11-25 09:38:17 +0100
committerGitHub <noreply@github.com>2022-11-25 09:38:17 +0100
commit64965cc658a6266ddb9878ffd53bd69e0a0f5b79 (patch)
tree495b63ec25d2b5e8d5888004e5bca0dcdf67704b /src/core/hle/service/nfp
parentMerge pull request #9194 from FernandoS27/yfc-fermi2d (diff)
parentservice: Make use of buffer element count helpers (diff)
downloadyuzu-64965cc658a6266ddb9878ffd53bd69e0a0f5b79.tar
yuzu-64965cc658a6266ddb9878ffd53bd69e0a0f5b79.tar.gz
yuzu-64965cc658a6266ddb9878ffd53bd69e0a0f5b79.tar.bz2
yuzu-64965cc658a6266ddb9878ffd53bd69e0a0f5b79.tar.lz
yuzu-64965cc658a6266ddb9878ffd53bd69e0a0f5b79.tar.xz
yuzu-64965cc658a6266ddb9878ffd53bd69e0a0f5b79.tar.zst
yuzu-64965cc658a6266ddb9878ffd53bd69e0a0f5b79.zip
Diffstat (limited to 'src/core/hle/service/nfp')
-rw-r--r--src/core/hle/service/nfp/nfp_user.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/service/nfp/nfp_user.cpp b/src/core/hle/service/nfp/nfp_user.cpp
index 2fe3c0ea0..49816b4c7 100644
--- a/src/core/hle/service/nfp/nfp_user.cpp
+++ b/src/core/hle/service/nfp/nfp_user.cpp
@@ -104,9 +104,9 @@ void IUser::ListDevices(Kernel::HLERequestContext& ctx) {
}
std::vector<u64> nfp_devices;
- const std::size_t max_allowed_devices = ctx.GetWriteBufferSize() / sizeof(u64);
+ const std::size_t max_allowed_devices = ctx.GetWriteBufferNumElements<u64>();
- for (auto& device : devices) {
+ for (const auto& device : devices) {
if (nfp_devices.size() >= max_allowed_devices) {
continue;
}
@@ -115,7 +115,7 @@ void IUser::ListDevices(Kernel::HLERequestContext& ctx) {
}
}
- if (nfp_devices.size() == 0) {
+ if (nfp_devices.empty()) {
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(DeviceNotFound);
return;