diff options
author | Lioncash <mathew1800@gmail.com> | 2022-11-23 19:25:14 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2022-11-23 19:43:20 +0100 |
commit | 97f273e94e83a679f42faa9c81916a1c058112e1 (patch) | |
tree | e2a2777ae3bec31b544516988fae36e8080150ff /src/core/hle/service/nfp | |
parent | hle_ipc: Add helper functions for getting number of buffer elements (diff) | |
download | yuzu-97f273e94e83a679f42faa9c81916a1c058112e1.tar yuzu-97f273e94e83a679f42faa9c81916a1c058112e1.tar.gz yuzu-97f273e94e83a679f42faa9c81916a1c058112e1.tar.bz2 yuzu-97f273e94e83a679f42faa9c81916a1c058112e1.tar.lz yuzu-97f273e94e83a679f42faa9c81916a1c058112e1.tar.xz yuzu-97f273e94e83a679f42faa9c81916a1c058112e1.tar.zst yuzu-97f273e94e83a679f42faa9c81916a1c058112e1.zip |
Diffstat (limited to 'src/core/hle/service/nfp')
-rw-r--r-- | src/core/hle/service/nfp/nfp_user.cpp | 6 |
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; |