From 2ad531b9c52720ba807975cdd9576514bd5f43a1 Mon Sep 17 00:00:00 2001 From: Squall-Leonhart Date: Fri, 22 Sep 2023 06:54:19 +1000 Subject: [PATCH] Updated SetSearchKey function to handle null search keys. Updated SetSearchKey function to handle null search keys. If a null search key is provided, the function now clears the search key at the specified index and returns success. --- src/Cafe/OS/libs/nn_olv/nn_olv_PostTypes.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Cafe/OS/libs/nn_olv/nn_olv_PostTypes.h b/src/Cafe/OS/libs/nn_olv/nn_olv_PostTypes.h index e6078a7aa..5109d9099 100644 --- a/src/Cafe/OS/libs/nn_olv/nn_olv_PostTypes.h +++ b/src/Cafe/OS/libs/nn_olv/nn_olv_PostTypes.h @@ -531,6 +531,11 @@ namespace nn // SetSearchKey__Q3_2nn3olv25DownloadPostDataListParamFPCwUc static nnResult SetSearchKey(DownloadPostDataListParam* _this, const uint16be* searchKey, uint8 searchKeyIndex) { + if( !searchKey ) + { + memset(&_this->searchKeyArray[searchKeyIndex], 0, sizeof(SearchKey)); + return OLV_RESULT_SUCCESS; + } if (searchKeyIndex >= MAX_NUM_SEARCH_KEY) return OLV_RESULT_INVALID_PARAMETER; memset(&_this->searchKeyArray[searchKeyIndex], 0, sizeof(SearchKey));