From a33bd0f81988aa132822454291d5e90aa25f8aab Mon Sep 17 00:00:00 2001 From: HookedBehemoth Date: Tue, 14 Jan 2020 03:28:17 +0100 Subject: [PATCH] fix typo and wrap out values --- nx/include/switch/services/capsa.h | 4 ++-- nx/source/services/capsa.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nx/include/switch/services/capsa.h b/nx/include/switch/services/capsa.h index 200507d7..0d62e3d9 100644 --- a/nx/include/switch/services/capsa.h +++ b/nx/include/switch/services/capsa.h @@ -62,7 +62,7 @@ Result capsaStorageCopyAlbumFile(const CapsAlbumFileId *file_id, CapsAlbumStorag /** * @brief Gets the mount status of the specified \ref CapsAlbumStorage. * @param[in] storage \ref CapsAlbumStorage - * @param[out] is_mounted Boolean over wether the storage is mounted or not. + * @param[out] is_mounted Boolean over whether the storage is mounted or not. */ Result capsaIsAlbumMounted(CapsAlbumStorage storage, bool *is_mounted); @@ -185,7 +185,7 @@ Result capsaGetAlbumUsage16(CapsAlbumStorage storage, CapsAlbumUsage16 *out); /** * @brief Returns the start and end of the Applet Id range. * @note Only available on [6.0.0+]. - * @param[out] success Returns bool over wether the call was handled or not. + * @param[out] success Returns bool over whether the call was handled or not. * @param[out] min Mimimum applet id. Always 0x0100000000001000 * @param[out] max Maximum applet id. Always 0x0100000000001FFF */ diff --git a/nx/source/services/capsa.c b/nx/source/services/capsa.c index e9f95c69..e011b543 100644 --- a/nx/source/services/capsa.c +++ b/nx/source/services/capsa.c @@ -196,9 +196,11 @@ Result capsaGetMinMaxAppletId(bool *success, u64* min, u64* max) { .buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out | SfBufferAttr_HipcMapTransferAllowsNonSecure, }, .buffers = { { app_ids, sizeof(app_ids) }, }, ); - *min = app_ids[0]; - *max = app_ids[1]; - *success = out.success; + if (R_SUCCEEDED(rc)) { + if (min) *min = app_ids[0]; + if (max) *max = app_ids[1]; + if (success) *success = out.success; + } return rc; }