From b33c5df54bc4dff291f6e8ccf6aa7e5e04108a37 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Fri, 4 Oct 2019 18:34:51 -0400 Subject: [PATCH] Updated readSetting to handle the out_size param from setsysGetSettingsItemValue with latest libnx. The buffer is now cleared on failure. --- source/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/main.c b/source/main.c index 11a5073..5f9a1c4 100644 --- a/source/main.c +++ b/source/main.c @@ -51,7 +51,10 @@ static Result readSetting(const char* key, void* buf, size_t size) if (R_SUCCEEDED(rc) && actual_size != size) rc = MAKERESULT(Module_Libnx, LibnxError_BadInput); if (R_SUCCEEDED(rc)) - rc = setsysGetSettingsItemValue(section_name, key, buf, size); + rc = setsysGetSettingsItemValue(section_name, key, buf, size, &actual_size); + if (R_SUCCEEDED(rc) && actual_size != size) + rc = MAKERESULT(Module_Libnx, LibnxError_BadInput); + if (R_FAILED(rc)) memset(buf, 0, size); return rc; }