Updated readSetting to handle the out_size param from setsysGetSettingsItemValue with latest libnx. The buffer is now cleared on failure.

This commit is contained in:
yellows8 2019-10-04 18:34:51 -04:00
parent 92a14f706e
commit b33c5df54b
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43

View File

@ -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;
}